{
 "cells": [
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "# Deep Learning"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 1,
   "metadata": {
    "ExecuteTime": {
     "end_time": "2017-05-10T17:33:36.039928Z",
     "start_time": "2017-05-10T17:33:34.158721Z"
    }
   },
   "outputs": [
    {
     "name": "stderr",
     "output_type": "stream",
     "text": [
      "Using TensorFlow backend.\n"
     ]
    }
   ],
   "source": [
    "from keras.layers import Input, Dense, Lambda, Layer\n",
    "from keras.models import Model\n",
    "from keras import regularizers\n",
    "import keras\n",
    "import pandas as pd\n",
    "import numpy as np\n",
    "from keras import backend as K\n",
    "from keras import metrics\n",
    "from collections import namedtuple\n",
    "pd.set_option(\"display.max_rows\",35)\n",
    "%matplotlib inline"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 2,
   "metadata": {
    "ExecuteTime": {
     "end_time": "2017-05-10T17:33:37.162037Z",
     "start_time": "2017-05-10T17:33:36.042015Z"
    },
    "collapsed": true
   },
   "outputs": [],
   "source": [
    "kdd_train_2labels = pd.read_pickle(\"dataset/kdd_train_2labels.pkl\")\n",
    "kdd_test_2labels = pd.read_pickle(\"dataset/kdd_test_2labels.pkl\")\n",
    "\n",
    "#y_train_labels = pd.read_pickle(\"dataset/kdd_train_2labels_y.pkl\")\n",
    "#y_train_labels = pd.read_pickle(\"dataset/kdd_train_2labels.pkl\")\n",
    "#y_test_labels = pd.read_pickle(\"dataset/kdd_test_2labels_y.pkl\")\n",
    "\n",
    "output_columns_2labels = ['is_Attack','is_Normal']\n",
    "\n",
    "from sklearn import model_selection as ms\n",
    "from sklearn import preprocessing as pp\n",
    "\n",
    "x_input = kdd_train_2labels.drop(output_columns_2labels, axis = 1)\n",
    "y_output = kdd_train_2labels.loc[:,output_columns_2labels]\n",
    "\n",
    "ss = pp.StandardScaler()\n",
    "x_input = ss.fit_transform(x_input)\n",
    "\n",
    "#le = pp.LabelEncoder()\n",
    "#y_train = le.fit_transform(y_train_labels).reshape(-1, 1)\n",
    "#y_test = le.transform(y_test_labels).reshape(-1, 1)\n",
    "\n",
    "y_train = kdd_train_2labels.loc[:,output_columns_2labels]\n",
    "\n",
    "x_train, x_valid, y_train, y_valid = ms.train_test_split(x_input, \n",
    "                              y_train, \n",
    "                              test_size=0.1)\n",
    "#x_valid, x_test, y_valid, y_test = ms.train_test_split(x_valid, y_valid, test_size = 0.4)\n",
    "\n",
    "x_test = kdd_test_2labels.drop(output_columns_2labels, axis = 1)\n",
    "y_test = kdd_test_2labels.loc[:,output_columns_2labels]\n",
    "\n",
    "x_test = ss.transform(x_test)\n",
    "\n",
    "#x_train = np.hstack((x_train, y_train))\n",
    "#x_valid = np.hstack((x_valid, y_valid))\n",
    "\n",
    "#x_test = np.hstack((x_test, np.random.normal(loc = 0, scale = 0.01, size = y_test.shape)))"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 3,
   "metadata": {
    "ExecuteTime": {
     "end_time": "2017-05-10T17:33:37.215955Z",
     "start_time": "2017-05-10T17:33:37.164353Z"
    },
    "collapsed": true
   },
   "outputs": [],
   "source": [
    "input_dim = 122\n",
    "intermediate_dim = 122\n",
    "latent_dim = 32\n",
    "batch_size = 1409\n",
    "epochs = 5\n",
    "hidden_layers = 8\n",
    "\n",
    "class Train:\n",
    "    def train():\n",
    "        Train.x = Input(shape=(input_dim,))\n",
    "        \n",
    "        hidden_encoder = Train.x\n",
    "        for i in range(hidden_layers):\n",
    "            hidden_encoder = Dense(intermediate_dim, activation='relu')(hidden_encoder)\n",
    "\n",
    "        Train.mean_encoder = Dense(latent_dim, activation=None)(hidden_encoder)\n",
    "        Train.logvar_encoder = Dense(latent_dim, activation=None)(hidden_encoder)\n",
    "\n",
    "        def get_distrib(args):\n",
    "\n",
    "            m_e, l_e = args\n",
    "\n",
    "            # Sample epsilon\n",
    "            epsilon = np.random.normal(loc=0.0, scale=0.05, size = (batch_size, latent_dim))\n",
    "\n",
    "            # Sample latent variable\n",
    "            z = m_e + K.exp(l_e / 2) * epsilon\n",
    "            return z\n",
    "\n",
    "        z = Lambda(get_distrib)([Train.mean_encoder, Train.logvar_encoder])\n",
    "\n",
    "        hidden_decoder = z\n",
    "        for i in range(hidden_layers):\n",
    "            hidden_decoder = Dense(intermediate_dim, activation=\"relu\")(hidden_decoder)\n",
    "\n",
    "        Train.x_ = Dense(input_dim, activation=None)(hidden_decoder)\n"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 4,
   "metadata": {
    "ExecuteTime": {
     "end_time": "2017-05-10T18:01:23.824463Z",
     "start_time": "2017-05-10T17:33:37.217523Z"
    },
    "scrolled": true
   },
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      " \n",
      " Current Layer Attributes - epochs:50 hidden layers:2 features count:2\n",
      "Train on 112720 samples, validate on 22544 samples\n",
      "Epoch 1/50\n",
      "112720/112720 [==============================] - 1s - loss: 0.9199 - acc: 0.0269 - val_loss: 1.8596 - val_acc: 0.0625\n",
      "Epoch 2/50\n",
      "112720/112720 [==============================] - 0s - loss: 582141.9507 - acc: 0.0783 - val_loss: 1.8115 - val_acc: 0.0812\n",
      "Epoch 3/50\n",
      "112720/112720 [==============================] - 0s - loss: 0.8251 - acc: 0.0915 - val_loss: 1.8051 - val_acc: 0.0964\n",
      "Epoch 4/50\n",
      "112720/112720 [==============================] - 0s - loss: 0.8081 - acc: 0.0959 - val_loss: 1.7915 - val_acc: 0.0837\n",
      "Epoch 5/50\n",
      "112720/112720 [==============================] - 0s - loss: 0.7937 - acc: 0.0984 - val_loss: 1.7811 - val_acc: 0.0872\n",
      "Epoch 6/50\n",
      "112720/112720 [==============================] - 0s - loss: 0.7851 - acc: 0.0991 - val_loss: 1.7735 - val_acc: 0.0931\n",
      "Epoch 7/50\n",
      "112720/112720 [==============================] - 0s - loss: 0.7788 - acc: 0.1232 - val_loss: 1.7668 - val_acc: 0.2175\n",
      "Epoch 8/50\n",
      "112720/112720 [==============================] - 0s - loss: 0.7734 - acc: 0.1794 - val_loss: 1.7611 - val_acc: 0.2503\n",
      "Epoch 9/50\n",
      "112720/112720 [==============================] - 0s - loss: 0.7689 - acc: 0.2150 - val_loss: 1.7557 - val_acc: 0.3145\n",
      "Epoch 10/50\n",
      "112720/112720 [==============================] - 0s - loss: 0.7649 - acc: 0.2464 - val_loss: 1.7519 - val_acc: 0.3426\n",
      "Epoch 11/50\n",
      "112720/112720 [==============================] - 0s - loss: 0.7613 - acc: 0.2739 - val_loss: 1.7481 - val_acc: 0.3681\n",
      "Epoch 12/50\n",
      "112720/112720 [==============================] - 0s - loss: 0.7581 - acc: 0.2991 - val_loss: 1.7448 - val_acc: 0.3927\n",
      "Epoch 13/50\n",
      "112720/112720 [==============================] - 0s - loss: 0.7551 - acc: 0.3186 - val_loss: 1.7413 - val_acc: 0.4124\n",
      "Epoch 14/50\n",
      "112720/112720 [==============================] - 0s - loss: 0.7524 - acc: 0.3360 - val_loss: 1.7386 - val_acc: 0.4487\n",
      "Epoch 15/50\n",
      "112720/112720 [==============================] - 0s - loss: 0.7500 - acc: 0.3672 - val_loss: 1.7363 - val_acc: 0.4745\n",
      "Epoch 16/50\n",
      "112720/112720 [==============================] - 0s - loss: 0.7477 - acc: 0.4022 - val_loss: 1.7337 - val_acc: 0.4976\n",
      "Epoch 17/50\n",
      "112720/112720 [==============================] - 0s - loss: 0.7456 - acc: 0.4523 - val_loss: 1.7321 - val_acc: 0.5173\n",
      "Epoch 18/50\n",
      "112720/112720 [==============================] - 0s - loss: 0.7437 - acc: 0.4694 - val_loss: 1.7297 - val_acc: 0.5316\n",
      "Epoch 19/50\n",
      "112720/112720 [==============================] - 0s - loss: 0.7419 - acc: 0.4796 - val_loss: 1.7281 - val_acc: 0.5425\n",
      "Epoch 20/50\n",
      "112720/112720 [==============================] - 0s - loss: 0.7402 - acc: 0.4879 - val_loss: 1.7265 - val_acc: 0.5538\n",
      "Epoch 21/50\n",
      "112720/112720 [==============================] - 0s - loss: 0.7387 - acc: 0.4959 - val_loss: 1.7249 - val_acc: 0.5597\n",
      "Epoch 22/50\n",
      "112720/112720 [==============================] - 0s - loss: 0.7373 - acc: 0.5036 - val_loss: 1.7237 - val_acc: 0.5636\n",
      "Epoch 23/50\n",
      "112720/112720 [==============================] - 0s - loss: 0.7359 - acc: 0.5073 - val_loss: 1.7225 - val_acc: 0.5679\n",
      "Epoch 24/50\n",
      "112720/112720 [==============================] - 0s - loss: 0.7347 - acc: 0.5124 - val_loss: 1.7214 - val_acc: 0.5721\n",
      "Epoch 25/50\n",
      "112720/112720 [==============================] - 0s - loss: 0.7335 - acc: 0.5163 - val_loss: 1.7201 - val_acc: 0.5755\n",
      "Epoch 26/50\n",
      "112720/112720 [==============================] - 0s - loss: 0.7323 - acc: 0.5197 - val_loss: 1.7189 - val_acc: 0.5798\n",
      "Epoch 27/50\n",
      "112720/112720 [==============================] - 0s - loss: 0.7312 - acc: 0.5235 - val_loss: 1.7180 - val_acc: 0.5828\n",
      "Epoch 28/50\n",
      "112720/112720 [==============================] - 0s - loss: 0.7302 - acc: 0.5263 - val_loss: 1.7170 - val_acc: 0.5856\n",
      "Epoch 29/50\n",
      "112720/112720 [==============================] - 0s - loss: 0.7292 - acc: 0.5308 - val_loss: 1.7160 - val_acc: 0.5937\n",
      "Epoch 30/50\n",
      "112720/112720 [==============================] - 0s - loss: 0.7282 - acc: 0.5336 - val_loss: 1.7156 - val_acc: 0.5998\n",
      "Epoch 31/50\n",
      "112720/112720 [==============================] - 0s - loss: 0.7273 - acc: 0.5355 - val_loss: 1.7145 - val_acc: 0.6060\n",
      "Epoch 32/50\n",
      "112720/112720 [==============================] - 0s - loss: 0.7264 - acc: 0.5387 - val_loss: 1.7134 - val_acc: 0.6082\n",
      "Epoch 33/50\n",
      "112720/112720 [==============================] - 0s - loss: 0.7256 - acc: 0.5398 - val_loss: 1.7128 - val_acc: 0.6091\n",
      "Epoch 34/50\n",
      "112720/112720 [==============================] - 0s - loss: 0.7247 - acc: 0.5447 - val_loss: 1.7120 - val_acc: 0.6121\n",
      "Epoch 35/50\n",
      "112720/112720 [==============================] - 0s - loss: 0.7239 - acc: 0.5469 - val_loss: 1.7113 - val_acc: 0.6128\n",
      "Epoch 36/50\n",
      "112720/112720 [==============================] - 0s - loss: 0.7232 - acc: 0.5482 - val_loss: 1.7105 - val_acc: 0.6144\n",
      "Epoch 37/50\n",
      "112720/112720 [==============================] - 0s - loss: 0.7224 - acc: 0.5496 - val_loss: 1.7099 - val_acc: 0.6158\n",
      "Epoch 38/50\n",
      "112720/112720 [==============================] - 0s - loss: 0.7217 - acc: 0.5515 - val_loss: 1.7092 - val_acc: 0.6170\n",
      "Epoch 39/50\n",
      "112720/112720 [==============================] - 0s - loss: 0.7210 - acc: 0.5525 - val_loss: 1.7087 - val_acc: 0.6172\n",
      "Epoch 40/50\n",
      "112720/112720 [==============================] - 0s - loss: 0.7203 - acc: 0.5534 - val_loss: 1.7080 - val_acc: 0.6180\n",
      "Epoch 41/50\n",
      "112720/112720 [==============================] - 0s - loss: 0.7196 - acc: 0.5544 - val_loss: 1.7073 - val_acc: 0.6189\n",
      "Epoch 42/50\n",
      "112720/112720 [==============================] - 0s - loss: 0.7190 - acc: 0.5556 - val_loss: 1.7066 - val_acc: 0.6197\n",
      "Epoch 43/50\n",
      "112720/112720 [==============================] - 0s - loss: 0.7184 - acc: 0.5567 - val_loss: 1.7060 - val_acc: 0.6202\n",
      "Epoch 44/50\n",
      "112720/112720 [==============================] - 0s - loss: 0.7178 - acc: 0.5573 - val_loss: 1.7054 - val_acc: 0.6208\n",
      "Epoch 45/50\n",
      "112720/112720 [==============================] - 0s - loss: 0.7172 - acc: 0.5590 - val_loss: 1.7048 - val_acc: 0.6208\n",
      "Epoch 46/50\n",
      "112720/112720 [==============================] - 0s - loss: 0.7166 - acc: 0.5592 - val_loss: 1.7044 - val_acc: 0.6215\n",
      "Epoch 47/50\n",
      "112720/112720 [==============================] - 0s - loss: 0.7160 - acc: 0.5606 - val_loss: 1.7038 - val_acc: 0.6217\n",
      "Epoch 48/50\n",
      "112720/112720 [==============================] - 0s - loss: 0.7155 - acc: 0.5616 - val_loss: 1.7032 - val_acc: 0.6221\n",
      "Epoch 49/50\n",
      "112720/112720 [==============================] - 0s - loss: 0.7149 - acc: 0.5621 - val_loss: 1.7024 - val_acc: 0.6226\n",
      "Epoch 50/50\n",
      "112720/112720 [==============================] - 0s - loss: 0.7144 - acc: 0.5633 - val_loss: 1.7020 - val_acc: 0.6228\n",
      "12681/22544 [===============>..............] - ETA: 0s\n",
      " Train Acc: 0.5582860186696053, Test Acc: 0.6228264793753624\n",
      " \n",
      " Current Layer Attributes - epochs:50 hidden layers:2 features count:4\n",
      "Train on 112720 samples, validate on 22544 samples\n",
      "Epoch 1/50\n",
      "112720/112720 [==============================] - 1s - loss: 2029.6692 - acc: 0.1130 - val_loss: 1.8693 - val_acc: 0.2849\n",
      "Epoch 2/50\n",
      "112720/112720 [==============================] - 1s - loss: 0.8458 - acc: 0.0908 - val_loss: 1.8262 - val_acc: 0.0473\n",
      "Epoch 3/50\n",
      "112720/112720 [==============================] - 1s - loss: 0.8137 - acc: 0.0929 - val_loss: 1.8018 - val_acc: 0.0649\n",
      "Epoch 4/50\n",
      "112720/112720 [==============================] - 1s - loss: 0.7902 - acc: 0.1254 - val_loss: 1.7843 - val_acc: 0.1987\n",
      "Epoch 5/50\n",
      "112720/112720 [==============================] - 1s - loss: 0.7736 - acc: 0.2560 - val_loss: 1.7716 - val_acc: 0.2889\n",
      "Epoch 6/50\n",
      "112720/112720 [==============================] - 1s - loss: 0.7609 - acc: 0.3291 - val_loss: 1.7628 - val_acc: 0.3694\n",
      "Epoch 7/50\n",
      "112720/112720 [==============================] - 1s - loss: 0.7505 - acc: 0.4032 - val_loss: 1.7539 - val_acc: 0.4084\n",
      "Epoch 8/50\n",
      "112720/112720 [==============================] - 0s - loss: 0.7421 - acc: 0.4155 - val_loss: 1.7479 - val_acc: 0.4318\n",
      "Epoch 9/50\n",
      "112720/112720 [==============================] - 0s - loss: 0.7350 - acc: 0.4257 - val_loss: 1.7431 - val_acc: 0.4383\n",
      "Epoch 10/50\n",
      "112720/112720 [==============================] - 0s - loss: 0.7288 - acc: 0.4289 - val_loss: 1.7389 - val_acc: 0.4427\n",
      "Epoch 11/50\n"
     ]
    },
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "112720/112720 [==============================] - 0s - loss: 0.7234 - acc: 0.4397 - val_loss: 1.7343 - val_acc: 0.4465\n",
      "Epoch 12/50\n",
      "112720/112720 [==============================] - 0s - loss: 0.7184 - acc: 0.4461 - val_loss: 1.7310 - val_acc: 0.4559\n",
      "Epoch 13/50\n",
      "112720/112720 [==============================] - 0s - loss: 0.7138 - acc: 0.4608 - val_loss: 1.7283 - val_acc: 0.4692\n",
      "Epoch 14/50\n",
      "112720/112720 [==============================] - 1s - loss: 0.7096 - acc: 0.4798 - val_loss: 1.7253 - val_acc: 0.4835\n",
      "Epoch 15/50\n",
      "112720/112720 [==============================] - 1s - loss: 0.7057 - acc: 0.4951 - val_loss: 1.7221 - val_acc: 0.4816\n",
      "Epoch 16/50\n",
      "112720/112720 [==============================] - 1s - loss: 0.7020 - acc: 0.5081 - val_loss: 1.7197 - val_acc: 0.4924\n",
      "Epoch 17/50\n",
      "112720/112720 [==============================] - 1s - loss: 0.6985 - acc: 0.5209 - val_loss: 1.7172 - val_acc: 0.4914\n",
      "Epoch 18/50\n",
      "112720/112720 [==============================] - 1s - loss: 0.6953 - acc: 0.5296 - val_loss: 1.7158 - val_acc: 0.5609\n",
      "Epoch 19/50\n",
      "112720/112720 [==============================] - 1s - loss: 0.6922 - acc: 0.5420 - val_loss: 1.7133 - val_acc: 0.4958\n",
      "Epoch 20/50\n",
      "112720/112720 [==============================] - 1s - loss: 0.6893 - acc: 0.5475 - val_loss: 1.7108 - val_acc: 0.5014\n",
      "Epoch 21/50\n",
      "112720/112720 [==============================] - 1s - loss: 0.6866 - acc: 0.5519 - val_loss: 1.7096 - val_acc: 0.4986\n",
      "Epoch 22/50\n",
      "112720/112720 [==============================] - 1s - loss: 0.6840 - acc: 0.5538 - val_loss: 1.7068 - val_acc: 0.5118\n",
      "Epoch 23/50\n",
      "112720/112720 [==============================] - 1s - loss: 0.6815 - acc: 0.5528 - val_loss: 1.7049 - val_acc: 0.5067\n",
      "Epoch 24/50\n",
      "112720/112720 [==============================] - 1s - loss: 0.6792 - acc: 0.5552 - val_loss: 1.7031 - val_acc: 0.5108\n",
      "Epoch 25/50\n",
      "112720/112720 [==============================] - 1s - loss: 0.6769 - acc: 0.5592 - val_loss: 1.7021 - val_acc: 0.5216\n",
      "Epoch 26/50\n",
      "112720/112720 [==============================] - 1s - loss: 0.6748 - acc: 0.5633 - val_loss: 1.6989 - val_acc: 0.5388\n",
      "Epoch 27/50\n",
      "112720/112720 [==============================] - 1s - loss: 0.6728 - acc: 0.5642 - val_loss: 1.6973 - val_acc: 0.5378\n",
      "Epoch 28/50\n",
      "112720/112720 [==============================] - 1s - loss: 0.6709 - acc: 0.5654 - val_loss: 1.6961 - val_acc: 0.5349\n",
      "Epoch 29/50\n",
      "112720/112720 [==============================] - 1s - loss: 0.6691 - acc: 0.5680 - val_loss: 1.6943 - val_acc: 0.5210\n",
      "Epoch 30/50\n",
      "112720/112720 [==============================] - 1s - loss: 0.6673 - acc: 0.5678 - val_loss: 1.6931 - val_acc: 0.5339\n",
      "Epoch 31/50\n",
      "112720/112720 [==============================] - 0s - loss: 0.6656 - acc: 0.5687 - val_loss: 1.6914 - val_acc: 0.5259\n",
      "Epoch 32/50\n",
      "112720/112720 [==============================] - 0s - loss: 0.6640 - acc: 0.5705 - val_loss: 1.6898 - val_acc: 0.5905\n",
      "Epoch 33/50\n",
      "112720/112720 [==============================] - 0s - loss: 0.6625 - acc: 0.5768 - val_loss: 1.6887 - val_acc: 0.5493\n",
      "Epoch 34/50\n",
      "112720/112720 [==============================] - 0s - loss: 0.6610 - acc: 0.5757 - val_loss: 1.6869 - val_acc: 0.6015\n",
      "Epoch 35/50\n",
      "112720/112720 [==============================] - 0s - loss: 0.6596 - acc: 0.5809 - val_loss: 1.6861 - val_acc: 0.5317\n",
      "Epoch 36/50\n",
      "112720/112720 [==============================] - 0s - loss: 0.6582 - acc: 0.5780 - val_loss: 1.6853 - val_acc: 0.6183\n",
      "Epoch 37/50\n",
      "112720/112720 [==============================] - 1s - loss: 0.6568 - acc: 0.5832 - val_loss: 1.6832 - val_acc: 0.6159\n",
      "Epoch 38/50\n",
      "112720/112720 [==============================] - 1s - loss: 0.6556 - acc: 0.5851 - val_loss: 1.6826 - val_acc: 0.6129\n",
      "Epoch 39/50\n",
      "112720/112720 [==============================] - 1s - loss: 0.6543 - acc: 0.5879 - val_loss: 1.6814 - val_acc: 0.6223\n",
      "Epoch 40/50\n",
      "112720/112720 [==============================] - 1s - loss: 0.6532 - acc: 0.5891 - val_loss: 1.6799 - val_acc: 0.6252\n",
      "Epoch 41/50\n",
      "112720/112720 [==============================] - 1s - loss: 0.6520 - acc: 0.5958 - val_loss: 1.6785 - val_acc: 0.6260\n",
      "Epoch 42/50\n",
      "112720/112720 [==============================] - 1s - loss: 0.6509 - acc: 0.5975 - val_loss: 1.6782 - val_acc: 0.6270\n",
      "Epoch 43/50\n",
      "112720/112720 [==============================] - 1s - loss: 0.6498 - acc: 0.6009 - val_loss: 1.6766 - val_acc: 0.6275\n",
      "Epoch 44/50\n",
      "112720/112720 [==============================] - 1s - loss: 0.6487 - acc: 0.5995 - val_loss: 1.6755 - val_acc: 0.6285\n",
      "Epoch 45/50\n",
      "112720/112720 [==============================] - 1s - loss: 0.6477 - acc: 0.6030 - val_loss: 1.6749 - val_acc: 0.6153\n",
      "Epoch 46/50\n",
      "112720/112720 [==============================] - 1s - loss: 0.6467 - acc: 0.6031 - val_loss: 1.6742 - val_acc: 0.6041\n",
      "Epoch 47/50\n",
      "112720/112720 [==============================] - 1s - loss: 0.6457 - acc: 0.6017 - val_loss: 1.6726 - val_acc: 0.6304\n",
      "Epoch 48/50\n",
      "112720/112720 [==============================] - 1s - loss: 0.6447 - acc: 0.6040 - val_loss: 1.6719 - val_acc: 0.6299\n",
      "Epoch 49/50\n",
      "112720/112720 [==============================] - 1s - loss: 0.6438 - acc: 0.6040 - val_loss: 1.6711 - val_acc: 0.6318\n",
      "Epoch 50/50\n",
      "112720/112720 [==============================] - 1s - loss: 0.6429 - acc: 0.6041 - val_loss: 1.6697 - val_acc: 0.6316\n",
      "14090/22544 [=================>............] - ETA: 0s\n",
      " Train Acc: 0.5956351980566978, Test Acc: 0.6316092945635319\n",
      " \n",
      " Current Layer Attributes - epochs:50 hidden layers:2 features count:8\n",
      "Train on 112720 samples, validate on 22544 samples\n",
      "Epoch 1/50\n",
      "112720/112720 [==============================] - 1s - loss: 1.3276 - acc: 0.2031 - val_loss: 1.7953 - val_acc: 0.0769\n",
      "Epoch 2/50\n",
      "112720/112720 [==============================] - 0s - loss: 0.7605 - acc: 0.1502 - val_loss: 1.7112 - val_acc: 0.2062\n",
      "Epoch 3/50\n",
      "112720/112720 [==============================] - 0s - loss: 0.7052 - acc: 0.2925 - val_loss: 1.6509 - val_acc: 0.4799\n",
      "Epoch 4/50\n",
      "112720/112720 [==============================] - 0s - loss: 0.6663 - acc: 0.5213 - val_loss: 1.6120 - val_acc: 0.6055\n",
      "Epoch 5/50\n",
      "112720/112720 [==============================] - 0s - loss: 0.6389 - acc: 0.5930 - val_loss: 1.5765 - val_acc: 0.6675\n",
      "Epoch 6/50\n",
      "112720/112720 [==============================] - 0s - loss: 0.6181 - acc: 0.6280 - val_loss: 1.5536 - val_acc: 0.7154\n",
      "Epoch 7/50\n",
      "112720/112720 [==============================] - 0s - loss: 0.6009 - acc: 0.6604 - val_loss: 1.5202 - val_acc: 0.7290\n",
      "Epoch 8/50\n",
      "112720/112720 [==============================] - 0s - loss: 0.5863 - acc: 0.6886 - val_loss: 1.4964 - val_acc: 0.7368\n",
      "Epoch 9/50\n",
      "112720/112720 [==============================] - 0s - loss: 0.5735 - acc: 0.7009 - val_loss: 1.4741 - val_acc: 0.7425\n",
      "Epoch 10/50\n",
      "112720/112720 [==============================] - 0s - loss: 0.5620 - acc: 0.7091 - val_loss: 1.4531 - val_acc: 0.7483\n",
      "Epoch 11/50\n",
      "112720/112720 [==============================] - 0s - loss: 0.5515 - acc: 0.7136 - val_loss: 1.4339 - val_acc: 0.7509\n",
      "Epoch 12/50\n",
      "112720/112720 [==============================] - 0s - loss: 0.5421 - acc: 0.7189 - val_loss: 1.4205 - val_acc: 0.7523\n",
      "Epoch 13/50\n",
      "112720/112720 [==============================] - 0s - loss: 0.5336 - acc: 0.7228 - val_loss: 1.3972 - val_acc: 0.7574\n",
      "Epoch 14/50\n",
      "112720/112720 [==============================] - 0s - loss: 0.5258 - acc: 0.7246 - val_loss: 1.3840 - val_acc: 0.7594\n",
      "Epoch 15/50\n",
      "112720/112720 [==============================] - 0s - loss: 0.5187 - acc: 0.7264 - val_loss: 1.3681 - val_acc: 0.7611\n",
      "Epoch 16/50\n",
      "112720/112720 [==============================] - 0s - loss: 0.5120 - acc: 0.7315 - val_loss: 1.3541 - val_acc: 0.7632\n",
      "Epoch 17/50\n",
      "112720/112720 [==============================] - 0s - loss: 0.5059 - acc: 0.7353 - val_loss: 1.3397 - val_acc: 0.7644\n",
      "Epoch 18/50\n",
      "112720/112720 [==============================] - 0s - loss: 0.5002 - acc: 0.7361 - val_loss: 1.3283 - val_acc: 0.7661\n",
      "Epoch 19/50\n",
      "112720/112720 [==============================] - 0s - loss: 0.4947 - acc: 0.7375 - val_loss: 1.3171 - val_acc: 0.7663\n",
      "Epoch 20/50\n",
      "112720/112720 [==============================] - 0s - loss: 0.4898 - acc: 0.7382 - val_loss: 1.3049 - val_acc: 0.7669\n",
      "Epoch 21/50\n",
      "112720/112720 [==============================] - 0s - loss: 0.4850 - acc: 0.7396 - val_loss: 1.2961 - val_acc: 0.7679\n",
      "Epoch 22/50\n"
     ]
    },
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "112720/112720 [==============================] - 0s - loss: 0.4805 - acc: 0.7400 - val_loss: 1.2844 - val_acc: 0.7693\n",
      "Epoch 23/50\n",
      "112720/112720 [==============================] - 0s - loss: 0.4762 - acc: 0.7416 - val_loss: 1.2753 - val_acc: 0.7713\n",
      "Epoch 24/50\n",
      "112720/112720 [==============================] - 0s - loss: 0.4722 - acc: 0.7451 - val_loss: 1.2650 - val_acc: 0.7716\n",
      "Epoch 25/50\n",
      "112720/112720 [==============================] - 0s - loss: 0.4684 - acc: 0.7461 - val_loss: 1.2566 - val_acc: 0.7733\n",
      "Epoch 26/50\n",
      "112720/112720 [==============================] - 0s - loss: 0.4647 - acc: 0.7477 - val_loss: 1.2476 - val_acc: 0.7740\n",
      "Epoch 27/50\n",
      "112720/112720 [==============================] - 0s - loss: 0.4612 - acc: 0.7501 - val_loss: 1.2390 - val_acc: 0.7755\n",
      "Epoch 28/50\n",
      "112720/112720 [==============================] - 0s - loss: 0.4580 - acc: 0.7509 - val_loss: 1.2305 - val_acc: 0.7757\n",
      "Epoch 29/50\n",
      "112720/112720 [==============================] - 0s - loss: 0.4548 - acc: 0.7513 - val_loss: 1.2228 - val_acc: 0.7770\n",
      "Epoch 30/50\n",
      "112720/112720 [==============================] - 0s - loss: 0.4516 - acc: 0.7519 - val_loss: 1.2139 - val_acc: 0.7772\n",
      "Epoch 31/50\n",
      "112720/112720 [==============================] - 0s - loss: 0.4487 - acc: 0.7523 - val_loss: 1.2067 - val_acc: 0.7800\n",
      "Epoch 32/50\n",
      "112720/112720 [==============================] - 0s - loss: 0.4459 - acc: 0.7532 - val_loss: 1.1985 - val_acc: 0.7801\n",
      "Epoch 33/50\n",
      "112720/112720 [==============================] - 0s - loss: 0.4431 - acc: 0.7538 - val_loss: 1.1907 - val_acc: 0.7814\n",
      "Epoch 34/50\n",
      "112720/112720 [==============================] - 0s - loss: 0.4405 - acc: 0.7544 - val_loss: 1.1839 - val_acc: 0.7822\n",
      "Epoch 35/50\n",
      "112720/112720 [==============================] - 0s - loss: 0.4379 - acc: 0.7547 - val_loss: 1.1760 - val_acc: 0.7820\n",
      "Epoch 36/50\n",
      "112720/112720 [==============================] - 0s - loss: 0.4355 - acc: 0.7547 - val_loss: 1.1696 - val_acc: 0.7825\n",
      "Epoch 37/50\n",
      "112720/112720 [==============================] - 0s - loss: 0.4330 - acc: 0.7549 - val_loss: 1.1629 - val_acc: 0.7827\n",
      "Epoch 38/50\n",
      "112720/112720 [==============================] - 0s - loss: 0.4307 - acc: 0.7552 - val_loss: 1.1560 - val_acc: 0.7830\n",
      "Epoch 39/50\n",
      "112720/112720 [==============================] - 0s - loss: 0.4285 - acc: 0.7552 - val_loss: 1.1497 - val_acc: 0.7833\n",
      "Epoch 40/50\n",
      "112720/112720 [==============================] - 0s - loss: 0.4262 - acc: 0.7552 - val_loss: 1.1432 - val_acc: 0.7832\n",
      "Epoch 41/50\n",
      "112720/112720 [==============================] - 0s - loss: 0.4241 - acc: 0.7556 - val_loss: 1.1377 - val_acc: 0.7834\n",
      "Epoch 42/50\n",
      "112720/112720 [==============================] - 0s - loss: 0.4220 - acc: 0.7558 - val_loss: 1.1310 - val_acc: 0.7842\n",
      "Epoch 43/50\n",
      "112720/112720 [==============================] - 0s - loss: 0.4201 - acc: 0.7563 - val_loss: 1.1250 - val_acc: 0.7848\n",
      "Epoch 44/50\n",
      "112720/112720 [==============================] - 0s - loss: 0.4181 - acc: 0.7567 - val_loss: 1.1193 - val_acc: 0.7851\n",
      "Epoch 45/50\n",
      "112720/112720 [==============================] - 0s - loss: 0.4161 - acc: 0.7568 - val_loss: 1.1144 - val_acc: 0.7853\n",
      "Epoch 46/50\n",
      "112720/112720 [==============================] - 0s - loss: 0.4143 - acc: 0.7573 - val_loss: 1.1082 - val_acc: 0.7858\n",
      "Epoch 47/50\n",
      "112720/112720 [==============================] - 0s - loss: 0.4124 - acc: 0.7573 - val_loss: 1.1038 - val_acc: 0.7857\n",
      "Epoch 48/50\n",
      "112720/112720 [==============================] - 0s - loss: 0.4106 - acc: 0.7574 - val_loss: 1.0989 - val_acc: 0.7860\n",
      "Epoch 49/50\n",
      "112720/112720 [==============================] - 0s - loss: 0.4089 - acc: 0.7575 - val_loss: 1.0932 - val_acc: 0.7862\n",
      "Epoch 50/50\n",
      "112720/112720 [==============================] - 0s - loss: 0.4071 - acc: 0.7574 - val_loss: 1.0878 - val_acc: 0.7863\n",
      "14090/22544 [=================>............] - ETA: 0s\n",
      " Train Acc: 0.755500353872776, Test Acc: 0.7863289564847946\n",
      " \n",
      " Current Layer Attributes - epochs:50 hidden layers:2 features count:16\n",
      "Train on 112720 samples, validate on 22544 samples\n",
      "Epoch 1/50\n",
      "112720/112720 [==============================] - 1s - loss: 47.9092 - acc: 0.0880 - val_loss: 1.7544 - val_acc: 0.1760\n",
      "Epoch 2/50\n",
      "112720/112720 [==============================] - 0s - loss: 17908303.9655 - acc: 0.2035 - val_loss: 1.7038 - val_acc: 0.2065\n",
      "Epoch 3/50\n",
      "112720/112720 [==============================] - 0s - loss: 25509.3348 - acc: 0.2199 - val_loss: 1.6846 - val_acc: 0.2154\n",
      "Epoch 4/50\n",
      "112720/112720 [==============================] - 0s - loss: 0.7042 - acc: 0.2961 - val_loss: 1.6698 - val_acc: 0.3601\n",
      "Epoch 5/50\n",
      "112720/112720 [==============================] - 0s - loss: 0.8218 - acc: 0.4826 - val_loss: 1.6610 - val_acc: 0.5155\n",
      "Epoch 6/50\n",
      "112720/112720 [==============================] - 0s - loss: 0.6864 - acc: 0.5511 - val_loss: 1.6515 - val_acc: 0.5453\n",
      "Epoch 7/50\n",
      "112720/112720 [==============================] - 0s - loss: 0.6809 - acc: 0.5727 - val_loss: 1.6453 - val_acc: 0.5658\n",
      "Epoch 8/50\n",
      "112720/112720 [==============================] - 0s - loss: 0.6762 - acc: 0.5875 - val_loss: 1.6398 - val_acc: 0.5829\n",
      "Epoch 9/50\n",
      "112720/112720 [==============================] - 0s - loss: 0.6719 - acc: 0.6007 - val_loss: 1.6354 - val_acc: 0.6055\n",
      "Epoch 10/50\n",
      "112720/112720 [==============================] - 0s - loss: 0.6681 - acc: 0.6098 - val_loss: 1.6309 - val_acc: 0.6155\n",
      "Epoch 11/50\n",
      "112720/112720 [==============================] - 0s - loss: 0.6645 - acc: 0.6145 - val_loss: 1.6250 - val_acc: 0.6182\n",
      "Epoch 12/50\n",
      "112720/112720 [==============================] - 0s - loss: 0.6612 - acc: 0.6170 - val_loss: 1.6208 - val_acc: 0.6204\n",
      "Epoch 13/50\n",
      "112720/112720 [==============================] - 0s - loss: 0.6581 - acc: 0.6187 - val_loss: 1.6161 - val_acc: 0.6231\n",
      "Epoch 14/50\n",
      "112720/112720 [==============================] - 0s - loss: 0.6551 - acc: 0.6203 - val_loss: 1.6120 - val_acc: 0.6244\n",
      "Epoch 15/50\n",
      "112720/112720 [==============================] - 0s - loss: 0.6521 - acc: 0.6220 - val_loss: 1.6082 - val_acc: 0.6281\n",
      "Epoch 16/50\n",
      "112720/112720 [==============================] - 0s - loss: 0.6494 - acc: 0.6248 - val_loss: 1.6047 - val_acc: 0.6297\n",
      "Epoch 17/50\n",
      "112720/112720 [==============================] - 0s - loss: 0.6468 - acc: 0.6281 - val_loss: 1.6010 - val_acc: 0.6317\n",
      "Epoch 18/50\n",
      "112720/112720 [==============================] - 0s - loss: 0.6444 - acc: 0.6310 - val_loss: 1.5978 - val_acc: 0.6330\n",
      "Epoch 19/50\n",
      "112720/112720 [==============================] - 0s - loss: 0.6421 - acc: 0.6324 - val_loss: 1.5948 - val_acc: 0.6346\n",
      "Epoch 20/50\n",
      "112720/112720 [==============================] - 0s - loss: 0.6399 - acc: 0.6335 - val_loss: 1.5918 - val_acc: 0.6351\n",
      "Epoch 21/50\n",
      "112720/112720 [==============================] - 0s - loss: 0.6377 - acc: 0.6351 - val_loss: 1.5891 - val_acc: 0.6360\n",
      "Epoch 22/50\n",
      "112720/112720 [==============================] - 0s - loss: 0.6355 - acc: 0.6376 - val_loss: 1.5864 - val_acc: 0.6364\n",
      "Epoch 23/50\n",
      "112720/112720 [==============================] - 0s - loss: 0.6336 - acc: 0.6400 - val_loss: 1.5844 - val_acc: 0.6385\n",
      "Epoch 24/50\n",
      "112720/112720 [==============================] - 0s - loss: 0.6316 - acc: 0.6429 - val_loss: 1.5813 - val_acc: 0.6388\n",
      "Epoch 25/50\n",
      "112720/112720 [==============================] - 0s - loss: 0.6297 - acc: 0.6450 - val_loss: 1.5790 - val_acc: 0.6396\n",
      "Epoch 26/50\n",
      "112720/112720 [==============================] - 0s - loss: 0.6279 - acc: 0.6479 - val_loss: 1.5765 - val_acc: 0.6406\n",
      "Epoch 27/50\n",
      "112720/112720 [==============================] - 0s - loss: 0.6262 - acc: 0.6506 - val_loss: 1.5744 - val_acc: 0.6417\n",
      "Epoch 28/50\n",
      "112720/112720 [==============================] - 0s - loss: 0.6244 - acc: 0.6525 - val_loss: 1.5721 - val_acc: 0.6435\n",
      "Epoch 29/50\n",
      "112720/112720 [==============================] - 0s - loss: 0.6227 - acc: 0.6542 - val_loss: 1.5698 - val_acc: 0.6440\n",
      "Epoch 30/50\n",
      "112720/112720 [==============================] - 0s - loss: 0.6211 - acc: 0.6566 - val_loss: 1.5677 - val_acc: 0.6445\n",
      "Epoch 31/50\n",
      "112720/112720 [==============================] - 0s - loss: 0.6195 - acc: 0.6596 - val_loss: 1.5656 - val_acc: 0.6454\n",
      "Epoch 32/50\n",
      "112720/112720 [==============================] - 0s - loss: 0.6179 - acc: 0.6611 - val_loss: 1.5637 - val_acc: 0.6457\n",
      "Epoch 33/50\n"
     ]
    },
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "112720/112720 [==============================] - 0s - loss: 0.6164 - acc: 0.6612 - val_loss: 1.5615 - val_acc: 0.6464\n",
      "Epoch 34/50\n",
      "112720/112720 [==============================] - 0s - loss: 0.6149 - acc: 0.6637 - val_loss: 1.5600 - val_acc: 0.6467\n",
      "Epoch 35/50\n",
      "112720/112720 [==============================] - 0s - loss: 0.6134 - acc: 0.6641 - val_loss: 1.5581 - val_acc: 0.6470\n",
      "Epoch 36/50\n",
      "112720/112720 [==============================] - 0s - loss: 0.6120 - acc: 0.6648 - val_loss: 1.5559 - val_acc: 0.6475\n",
      "Epoch 37/50\n",
      "112720/112720 [==============================] - 0s - loss: 0.6106 - acc: 0.6652 - val_loss: 1.5539 - val_acc: 0.6482\n",
      "Epoch 38/50\n",
      "112720/112720 [==============================] - 0s - loss: 0.6093 - acc: 0.6665 - val_loss: 1.5521 - val_acc: 0.6484\n",
      "Epoch 39/50\n",
      "112720/112720 [==============================] - 0s - loss: 0.6079 - acc: 0.6671 - val_loss: 1.5504 - val_acc: 0.6489\n",
      "Epoch 40/50\n",
      "112720/112720 [==============================] - 0s - loss: 0.6066 - acc: 0.6693 - val_loss: 1.5487 - val_acc: 0.6498\n",
      "Epoch 41/50\n",
      "112720/112720 [==============================] - 0s - loss: 0.6053 - acc: 0.6710 - val_loss: 1.5469 - val_acc: 0.6500\n",
      "Epoch 42/50\n",
      "112720/112720 [==============================] - 0s - loss: 0.6040 - acc: 0.6721 - val_loss: 1.5452 - val_acc: 0.6503\n",
      "Epoch 43/50\n",
      "112720/112720 [==============================] - 0s - loss: 0.6028 - acc: 0.6726 - val_loss: 1.5438 - val_acc: 0.6510\n",
      "Epoch 44/50\n",
      "112720/112720 [==============================] - 0s - loss: 0.6016 - acc: 0.6734 - val_loss: 1.5419 - val_acc: 0.6515\n",
      "Epoch 45/50\n",
      "112720/112720 [==============================] - 0s - loss: 0.6004 - acc: 0.6737 - val_loss: 1.5404 - val_acc: 0.6516\n",
      "Epoch 46/50\n",
      "112720/112720 [==============================] - 0s - loss: 0.5992 - acc: 0.6738 - val_loss: 1.5387 - val_acc: 0.6518\n",
      "Epoch 47/50\n",
      "112720/112720 [==============================] - 0s - loss: 0.5981 - acc: 0.6746 - val_loss: 1.5372 - val_acc: 0.6523\n",
      "Epoch 48/50\n",
      "112720/112720 [==============================] - 0s - loss: 0.5969 - acc: 0.6749 - val_loss: 1.5357 - val_acc: 0.6529\n",
      "Epoch 49/50\n",
      "112720/112720 [==============================] - 0s - loss: 0.5958 - acc: 0.6756 - val_loss: 1.5341 - val_acc: 0.6532\n",
      "Epoch 50/50\n",
      "112720/112720 [==============================] - 0s - loss: 0.5948 - acc: 0.6756 - val_loss: 1.5327 - val_acc: 0.6535\n",
      "14090/22544 [=================>............] - ETA: 0s\n",
      " Train Acc: 0.6665188148617744, Test Acc: 0.6534776464104652\n",
      " \n",
      " Current Layer Attributes - epochs:50 hidden layers:2 features count:32\n",
      "Train on 112720 samples, validate on 22544 samples\n",
      "Epoch 1/50\n",
      "112720/112720 [==============================] - 1s - loss: 850420824001.0552 - acc: 0.0963 - val_loss: 1977327082045440.7500 - val_acc: 0.0573\n",
      "Epoch 2/50\n",
      "112720/112720 [==============================] - 1s - loss: nan - acc: 0.0696 - val_loss: nan - val_acc: 1.7743e-04\n",
      "Epoch 3/50\n",
      "112720/112720 [==============================] - 1s - loss: nan - acc: 0.0050 - val_loss: nan - val_acc: 1.7743e-04\n",
      "Epoch 4/50\n",
      "112720/112720 [==============================] - 0s - loss: nan - acc: 0.0050 - val_loss: nan - val_acc: 1.7743e-04\n",
      "Epoch 5/50\n",
      "112720/112720 [==============================] - 1s - loss: nan - acc: 0.0050 - val_loss: nan - val_acc: 1.7743e-04\n",
      "Epoch 6/50\n",
      "112720/112720 [==============================] - 1s - loss: nan - acc: 0.0050 - val_loss: nan - val_acc: 1.7743e-04\n",
      "Epoch 7/50\n",
      "112720/112720 [==============================] - 0s - loss: nan - acc: 0.0050 - val_loss: nan - val_acc: 1.7743e-04\n",
      "Epoch 8/50\n",
      "112720/112720 [==============================] - 1s - loss: nan - acc: 0.0050 - val_loss: nan - val_acc: 1.7743e-04\n",
      "Epoch 9/50\n",
      "112720/112720 [==============================] - 0s - loss: nan - acc: 0.0050 - val_loss: nan - val_acc: 1.7743e-04\n",
      "Epoch 10/50\n",
      "112720/112720 [==============================] - 1s - loss: nan - acc: 0.0050 - val_loss: nan - val_acc: 1.7743e-04\n",
      "Epoch 11/50\n",
      "112720/112720 [==============================] - 1s - loss: nan - acc: 0.0050 - val_loss: nan - val_acc: 1.7743e-04\n",
      "Epoch 12/50\n",
      "112720/112720 [==============================] - 1s - loss: nan - acc: 0.0050 - val_loss: nan - val_acc: 1.7743e-04\n",
      "Epoch 13/50\n",
      "112720/112720 [==============================] - 0s - loss: nan - acc: 0.0050 - val_loss: nan - val_acc: 1.7743e-04\n",
      "Epoch 14/50\n",
      "112720/112720 [==============================] - 1s - loss: nan - acc: 0.0050 - val_loss: nan - val_acc: 1.7743e-04\n",
      "Epoch 15/50\n",
      "112720/112720 [==============================] - 1s - loss: nan - acc: 0.0050 - val_loss: nan - val_acc: 1.7743e-04\n",
      "Epoch 16/50\n",
      "112720/112720 [==============================] - 0s - loss: nan - acc: 0.0050 - val_loss: nan - val_acc: 1.7743e-04\n",
      "Epoch 17/50\n",
      "112720/112720 [==============================] - 0s - loss: nan - acc: 0.0050 - val_loss: nan - val_acc: 1.7743e-04\n",
      "Epoch 18/50\n",
      "112720/112720 [==============================] - 1s - loss: nan - acc: 0.0050 - val_loss: nan - val_acc: 1.7743e-04\n",
      "Epoch 19/50\n",
      "112720/112720 [==============================] - 1s - loss: nan - acc: 0.0050 - val_loss: nan - val_acc: 1.7743e-04\n",
      "Epoch 20/50\n",
      "112720/112720 [==============================] - 1s - loss: nan - acc: 0.0050 - val_loss: nan - val_acc: 1.7743e-04\n",
      "Epoch 21/50\n",
      "112720/112720 [==============================] - 1s - loss: nan - acc: 0.0050 - val_loss: nan - val_acc: 1.7743e-04\n",
      "Epoch 22/50\n",
      "112720/112720 [==============================] - 1s - loss: nan - acc: 0.0050 - val_loss: nan - val_acc: 1.7743e-04\n",
      "Epoch 23/50\n",
      "112720/112720 [==============================] - 1s - loss: nan - acc: 0.0050 - val_loss: nan - val_acc: 1.7743e-04\n",
      "Epoch 24/50\n",
      "112720/112720 [==============================] - 1s - loss: nan - acc: 0.0050 - val_loss: nan - val_acc: 1.7743e-04\n",
      "Epoch 25/50\n",
      "112720/112720 [==============================] - 1s - loss: nan - acc: 0.0050 - val_loss: nan - val_acc: 1.7743e-04\n",
      "Epoch 26/50\n",
      "112720/112720 [==============================] - 1s - loss: nan - acc: 0.0050 - val_loss: nan - val_acc: 1.7743e-04\n",
      "Epoch 27/50\n",
      "112720/112720 [==============================] - 1s - loss: nan - acc: 0.0050 - val_loss: nan - val_acc: 1.7743e-04\n",
      "Epoch 28/50\n",
      "112720/112720 [==============================] - 1s - loss: nan - acc: 0.0050 - val_loss: nan - val_acc: 1.7743e-04\n",
      "Epoch 29/50\n",
      "112720/112720 [==============================] - 1s - loss: nan - acc: 0.0050 - val_loss: nan - val_acc: 1.7743e-04\n",
      "Epoch 30/50\n",
      "112720/112720 [==============================] - 1s - loss: nan - acc: 0.0050 - val_loss: nan - val_acc: 1.7743e-04\n",
      "Epoch 31/50\n",
      "112720/112720 [==============================] - 0s - loss: nan - acc: 0.0050 - val_loss: nan - val_acc: 1.7743e-04\n",
      "Epoch 32/50\n",
      "112720/112720 [==============================] - 1s - loss: nan - acc: 0.0050 - val_loss: nan - val_acc: 1.7743e-04\n",
      "Epoch 33/50\n",
      "112720/112720 [==============================] - 0s - loss: nan - acc: 0.0050 - val_loss: nan - val_acc: 1.7743e-04\n",
      "Epoch 34/50\n",
      "112720/112720 [==============================] - 1s - loss: nan - acc: 0.0050 - val_loss: nan - val_acc: 1.7743e-04\n",
      "Epoch 35/50\n",
      "112720/112720 [==============================] - 1s - loss: nan - acc: 0.0050 - val_loss: nan - val_acc: 1.7743e-04\n",
      "Epoch 36/50\n",
      "112720/112720 [==============================] - 1s - loss: nan - acc: 0.0050 - val_loss: nan - val_acc: 1.7743e-04\n",
      "Epoch 37/50\n",
      "112720/112720 [==============================] - 1s - loss: nan - acc: 0.0050 - val_loss: nan - val_acc: 1.7743e-04\n",
      "Epoch 38/50\n",
      "112720/112720 [==============================] - 0s - loss: nan - acc: 0.0050 - val_loss: nan - val_acc: 1.7743e-04\n",
      "Epoch 39/50\n",
      "112720/112720 [==============================] - 0s - loss: nan - acc: 0.0050 - val_loss: nan - val_acc: 1.7743e-04\n",
      "Epoch 40/50\n",
      "112720/112720 [==============================] - 0s - loss: nan - acc: 0.0050 - val_loss: nan - val_acc: 1.7743e-04\n",
      "Epoch 41/50\n",
      "112720/112720 [==============================] - 1s - loss: nan - acc: 0.0050 - val_loss: nan - val_acc: 1.7743e-04\n",
      "Epoch 42/50\n",
      "112720/112720 [==============================] - 1s - loss: nan - acc: 0.0050 - val_loss: nan - val_acc: 1.7743e-04\n",
      "Epoch 43/50\n",
      "112720/112720 [==============================] - 1s - loss: nan - acc: 0.0050 - val_loss: nan - val_acc: 1.7743e-04\n",
      "Epoch 44/50\n"
     ]
    },
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "112720/112720 [==============================] - 1s - loss: nan - acc: 0.0050 - val_loss: nan - val_acc: 1.7743e-04\n",
      "Epoch 45/50\n",
      "112720/112720 [==============================] - 1s - loss: nan - acc: 0.0050 - val_loss: nan - val_acc: 1.7743e-04\n",
      "Epoch 46/50\n",
      "112720/112720 [==============================] - 1s - loss: nan - acc: 0.0050 - val_loss: nan - val_acc: 1.7743e-04\n",
      "Epoch 47/50\n",
      "112720/112720 [==============================] - 1s - loss: nan - acc: 0.0050 - val_loss: nan - val_acc: 1.7743e-04\n",
      "Epoch 48/50\n",
      "112720/112720 [==============================] - 1s - loss: nan - acc: 0.0050 - val_loss: nan - val_acc: 1.7743e-04\n",
      "Epoch 49/50\n",
      "112720/112720 [==============================] - 1s - loss: nan - acc: 0.0050 - val_loss: nan - val_acc: 1.7743e-04\n",
      "Epoch 50/50\n",
      "112720/112720 [==============================] - 1s - loss: nan - acc: 0.0050 - val_loss: nan - val_acc: 1.7743e-04\n",
      "14090/22544 [=================>............] - ETA: 0s\n",
      " Train Acc: 0.005145493312738836, Test Acc: 0.00017743080388754606\n",
      " \n",
      " Current Layer Attributes - epochs:50 hidden layers:6 features count:2\n",
      "Train on 112720 samples, validate on 22544 samples\n",
      "Epoch 1/50\n",
      "112720/112720 [==============================] - 3s - loss: 0.9555 - acc: 0.0783 - val_loss: 1.8749 - val_acc: 0.0191\n",
      "Epoch 2/50\n",
      "112720/112720 [==============================] - 1s - loss: 0.8346 - acc: 0.0401 - val_loss: 1.8274 - val_acc: 0.0936\n",
      "Epoch 3/50\n",
      "112720/112720 [==============================] - 1s - loss: 0.7942 - acc: 0.1306 - val_loss: 1.7950 - val_acc: 0.4240\n",
      "Epoch 4/50\n",
      "112720/112720 [==============================] - 1s - loss: 0.7640 - acc: 0.4109 - val_loss: 1.7753 - val_acc: 0.4336\n",
      "Epoch 5/50\n",
      "112720/112720 [==============================] - 1s - loss: 0.7415 - acc: 0.3739 - val_loss: 1.7623 - val_acc: 0.2901\n",
      "Epoch 6/50\n",
      "112720/112720 [==============================] - 2s - loss: 0.7255 - acc: 0.3413 - val_loss: 1.7582 - val_acc: 0.1617\n",
      "Epoch 7/50\n",
      "112720/112720 [==============================] - 1s - loss: 0.7155 - acc: 0.3607 - val_loss: 1.7477 - val_acc: 0.4467\n",
      "Epoch 8/50\n",
      "112720/112720 [==============================] - 2s - loss: 0.7076 - acc: 0.4028 - val_loss: 1.7452 - val_acc: 0.4572\n",
      "Epoch 9/50\n",
      "112720/112720 [==============================] - 2s - loss: 0.7015 - acc: 0.4314 - val_loss: 1.7433 - val_acc: 0.4616\n",
      "Epoch 10/50\n",
      "112720/112720 [==============================] - 2s - loss: 0.6960 - acc: 0.4376 - val_loss: 1.7380 - val_acc: 0.4737\n",
      "Epoch 11/50\n",
      "112720/112720 [==============================] - 2s - loss: 0.6905 - acc: 0.4586 - val_loss: 1.7373 - val_acc: 0.4948\n",
      "Epoch 12/50\n",
      "112720/112720 [==============================] - 2s - loss: 0.6859 - acc: 0.4801 - val_loss: 1.7346 - val_acc: 0.4990\n",
      "Epoch 13/50\n",
      "112720/112720 [==============================] - 2s - loss: 0.6812 - acc: 0.4916 - val_loss: 1.7294 - val_acc: 0.5088\n",
      "Epoch 14/50\n",
      "112720/112720 [==============================] - 2s - loss: 0.6768 - acc: 0.4973 - val_loss: 1.7251 - val_acc: 0.5113\n",
      "Epoch 15/50\n",
      "112720/112720 [==============================] - 2s - loss: 0.6729 - acc: 0.5096 - val_loss: 1.7228 - val_acc: 0.5171\n",
      "Epoch 16/50\n",
      "112720/112720 [==============================] - 2s - loss: 0.6699 - acc: 0.5222 - val_loss: 1.7231 - val_acc: 0.5194\n",
      "Epoch 17/50\n",
      "112720/112720 [==============================] - 2s - loss: 0.6651 - acc: 0.5315 - val_loss: 1.7146 - val_acc: 0.5221\n",
      "Epoch 18/50\n",
      "112720/112720 [==============================] - 2s - loss: 0.6615 - acc: 0.5345 - val_loss: 1.7095 - val_acc: 0.5244\n",
      "Epoch 19/50\n",
      "112720/112720 [==============================] - 2s - loss: 0.6585 - acc: 0.5380 - val_loss: 1.7083 - val_acc: 0.5268\n",
      "Epoch 20/50\n",
      "112720/112720 [==============================] - 2s - loss: 0.6553 - acc: 0.5430 - val_loss: 1.7046 - val_acc: 0.5282\n",
      "Epoch 21/50\n",
      "112720/112720 [==============================] - 2s - loss: 0.6523 - acc: 0.5468 - val_loss: 1.6993 - val_acc: 0.5290\n",
      "Epoch 22/50\n",
      "112720/112720 [==============================] - 2s - loss: 0.6494 - acc: 0.5499 - val_loss: 1.6990 - val_acc: 0.5322\n",
      "Epoch 23/50\n",
      "112720/112720 [==============================] - 2s - loss: 0.6464 - acc: 0.5541 - val_loss: 1.6912 - val_acc: 0.5307\n",
      "Epoch 24/50\n",
      "112720/112720 [==============================] - 2s - loss: 0.6439 - acc: 0.5558 - val_loss: 1.6875 - val_acc: 0.5358\n",
      "Epoch 25/50\n",
      "112720/112720 [==============================] - 2s - loss: 0.6416 - acc: 0.5694 - val_loss: 1.6910 - val_acc: 0.5347\n",
      "Epoch 26/50\n",
      "112720/112720 [==============================] - 1s - loss: 0.6391 - acc: 0.5647 - val_loss: 1.6840 - val_acc: 0.5335\n",
      "Epoch 27/50\n",
      "112720/112720 [==============================] - 2s - loss: 0.6367 - acc: 0.5671 - val_loss: 1.6838 - val_acc: 0.5338\n",
      "Epoch 28/50\n",
      "112720/112720 [==============================] - 2s - loss: 0.6344 - acc: 0.5761 - val_loss: 1.6779 - val_acc: 0.5393\n",
      "Epoch 29/50\n",
      "112720/112720 [==============================] - 2s - loss: 0.6326 - acc: 0.5775 - val_loss: 1.6766 - val_acc: 0.5360\n",
      "Epoch 30/50\n",
      "112720/112720 [==============================] - 2s - loss: 0.6304 - acc: 0.5747 - val_loss: 1.6743 - val_acc: 0.5926\n",
      "Epoch 31/50\n",
      "112720/112720 [==============================] - 2s - loss: 0.6286 - acc: 0.5702 - val_loss: 1.6766 - val_acc: 0.5359\n",
      "Epoch 32/50\n",
      "112720/112720 [==============================] - 2s - loss: 0.6269 - acc: 0.5768 - val_loss: 1.6679 - val_acc: 0.5457\n",
      "Epoch 33/50\n",
      "112720/112720 [==============================] - 2s - loss: 0.6250 - acc: 0.5880 - val_loss: 1.6707 - val_acc: 0.5761\n",
      "Epoch 34/50\n",
      "112720/112720 [==============================] - 2s - loss: 0.6233 - acc: 0.5912 - val_loss: 1.6679 - val_acc: 0.5514\n",
      "Epoch 35/50\n",
      "112720/112720 [==============================] - 2s - loss: 0.6217 - acc: 0.5863 - val_loss: 1.6646 - val_acc: 0.5477\n",
      "Epoch 36/50\n",
      "112720/112720 [==============================] - 2s - loss: 0.6201 - acc: 0.5908 - val_loss: 1.6636 - val_acc: 0.5535\n",
      "Epoch 37/50\n",
      "112720/112720 [==============================] - 2s - loss: 0.6186 - acc: 0.5917 - val_loss: 1.6628 - val_acc: 0.6226\n",
      "Epoch 38/50\n",
      "112720/112720 [==============================] - 2s - loss: 0.6171 - acc: 0.6006 - val_loss: 1.6631 - val_acc: 0.5635\n",
      "Epoch 39/50\n",
      "112720/112720 [==============================] - 2s - loss: 0.6155 - acc: 0.6042 - val_loss: 1.6593 - val_acc: 0.6058\n",
      "Epoch 40/50\n",
      "112720/112720 [==============================] - 2s - loss: 0.6140 - acc: 0.6048 - val_loss: 1.6576 - val_acc: 0.6318\n",
      "Epoch 41/50\n",
      "112720/112720 [==============================] - 2s - loss: 0.6128 - acc: 0.6078 - val_loss: 1.6566 - val_acc: 0.6197\n",
      "Epoch 42/50\n",
      "112720/112720 [==============================] - 2s - loss: 0.6112 - acc: 0.6151 - val_loss: 1.6545 - val_acc: 0.6329\n",
      "Epoch 43/50\n",
      "112720/112720 [==============================] - 2s - loss: 0.6101 - acc: 0.6237 - val_loss: 1.6528 - val_acc: 0.6337\n",
      "Epoch 44/50\n",
      "112720/112720 [==============================] - 2s - loss: 0.6088 - acc: 0.6119 - val_loss: 1.6523 - val_acc: 0.6340\n",
      "Epoch 45/50\n",
      "112720/112720 [==============================] - 2s - loss: 0.6074 - acc: 0.6104 - val_loss: 1.6489 - val_acc: 0.6538\n",
      "Epoch 46/50\n",
      "112720/112720 [==============================] - 2s - loss: 0.6064 - acc: 0.6252 - val_loss: 1.6490 - val_acc: 0.6360\n",
      "Epoch 47/50\n",
      "112720/112720 [==============================] - 2s - loss: 0.6052 - acc: 0.6265 - val_loss: 1.6504 - val_acc: 0.6346\n",
      "Epoch 48/50\n",
      "112720/112720 [==============================] - 2s - loss: 0.6039 - acc: 0.6150 - val_loss: 1.6463 - val_acc: 0.6339\n",
      "Epoch 49/50\n",
      "112720/112720 [==============================] - 2s - loss: 0.6028 - acc: 0.6254 - val_loss: 1.6459 - val_acc: 0.6678\n",
      "Epoch 50/50\n",
      "112720/112720 [==============================] - 2s - loss: 0.6016 - acc: 0.6236 - val_loss: 1.6472 - val_acc: 0.6363\n",
      "18317/22544 [=======================>......] - ETA: 0s\n",
      " Train Acc: 0.6008694171905518, Test Acc: 0.6362668536603451\n",
      " \n",
      " Current Layer Attributes - epochs:50 hidden layers:6 features count:4\n",
      "Train on 112720 samples, validate on 22544 samples\n",
      "Epoch 1/50\n",
      "112720/112720 [==============================] - 3s - loss: 0.9400 - acc: 0.0016 - val_loss: 1.8741 - val_acc: 0.0015\n",
      "Epoch 2/50\n",
      "112720/112720 [==============================] - 2s - loss: 0.8411 - acc: 0.0319 - val_loss: 1.8292 - val_acc: 0.0124\n",
      "Epoch 3/50\n"
     ]
    },
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "112720/112720 [==============================] - 2s - loss: 0.7966 - acc: 0.0485 - val_loss: 1.7858 - val_acc: 0.0480\n",
      "Epoch 4/50\n",
      "112720/112720 [==============================] - 2s - loss: 0.7558 - acc: 0.1447 - val_loss: 1.7432 - val_acc: 0.2949\n",
      "Epoch 5/50\n",
      "112720/112720 [==============================] - 2s - loss: 0.7201 - acc: 0.3122 - val_loss: 1.7054 - val_acc: 0.4809\n",
      "Epoch 6/50\n",
      "112720/112720 [==============================] - 2s - loss: 0.6867 - acc: 0.4844 - val_loss: 1.6572 - val_acc: 0.6141\n",
      "Epoch 7/50\n",
      "112720/112720 [==============================] - 2s - loss: 0.6561 - acc: 0.5902 - val_loss: 1.6157 - val_acc: 0.6495\n",
      "Epoch 8/50\n",
      "112720/112720 [==============================] - 2s - loss: 0.6346 - acc: 0.6122 - val_loss: 1.5670 - val_acc: 0.6643\n",
      "Epoch 9/50\n",
      "112720/112720 [==============================] - 1s - loss: 0.6128 - acc: 0.6258 - val_loss: 1.5293 - val_acc: 0.6729\n",
      "Epoch 10/50\n",
      "112720/112720 [==============================] - 1s - loss: 0.5965 - acc: 0.6422 - val_loss: 1.4851 - val_acc: 0.6815\n",
      "Epoch 11/50\n",
      "112720/112720 [==============================] - 2s - loss: 0.5807 - acc: 0.6677 - val_loss: 1.4520 - val_acc: 0.6904\n",
      "Epoch 12/50\n",
      "112720/112720 [==============================] - 2s - loss: 0.5665 - acc: 0.6938 - val_loss: 1.4212 - val_acc: 0.7128\n",
      "Epoch 13/50\n",
      "112720/112720 [==============================] - 2s - loss: 0.5545 - acc: 0.7259 - val_loss: 1.3879 - val_acc: 0.7469\n",
      "Epoch 14/50\n",
      "112720/112720 [==============================] - 2s - loss: 0.5424 - acc: 0.7448 - val_loss: 1.3634 - val_acc: 0.7354\n",
      "Epoch 15/50\n",
      "112720/112720 [==============================] - 2s - loss: 0.5321 - acc: 0.7613 - val_loss: 1.3322 - val_acc: 0.7355\n",
      "Epoch 16/50\n",
      "112720/112720 [==============================] - 2s - loss: 0.5230 - acc: 0.7732 - val_loss: 1.3126 - val_acc: 0.7315\n",
      "Epoch 17/50\n",
      "112720/112720 [==============================] - 2s - loss: 0.5150 - acc: 0.8011 - val_loss: 1.2929 - val_acc: 0.7605\n",
      "Epoch 18/50\n",
      "112720/112720 [==============================] - 2s - loss: 0.5069 - acc: 0.7944 - val_loss: 1.2684 - val_acc: 0.7630\n",
      "Epoch 19/50\n",
      "112720/112720 [==============================] - 2s - loss: 0.4994 - acc: 0.8117 - val_loss: 1.2577 - val_acc: 0.7642\n",
      "Epoch 20/50\n",
      "112720/112720 [==============================] - 2s - loss: 0.4932 - acc: 0.8179 - val_loss: 1.2501 - val_acc: 0.7670\n",
      "Epoch 21/50\n",
      "112720/112720 [==============================] - 2s - loss: 0.4871 - acc: 0.8257 - val_loss: 1.2222 - val_acc: 0.7713\n",
      "Epoch 22/50\n",
      "112720/112720 [==============================] - 2s - loss: 0.4821 - acc: 0.8304 - val_loss: 1.2112 - val_acc: 0.7826\n",
      "Epoch 23/50\n",
      "112720/112720 [==============================] - 2s - loss: 0.4764 - acc: 0.8332 - val_loss: 1.1955 - val_acc: 0.7767\n",
      "Epoch 24/50\n",
      "112720/112720 [==============================] - 2s - loss: 0.4721 - acc: 0.8331 - val_loss: 1.1863 - val_acc: 0.7848\n",
      "Epoch 25/50\n",
      "112720/112720 [==============================] - 2s - loss: 0.4673 - acc: 0.8343 - val_loss: 1.1734 - val_acc: 0.7852\n",
      "Epoch 26/50\n",
      "112720/112720 [==============================] - 2s - loss: 0.4636 - acc: 0.8359 - val_loss: 1.1623 - val_acc: 0.7840\n",
      "Epoch 27/50\n",
      "112720/112720 [==============================] - 2s - loss: 0.4589 - acc: 0.8376 - val_loss: 1.1503 - val_acc: 0.7848\n",
      "Epoch 28/50\n",
      "112720/112720 [==============================] - 2s - loss: 0.4551 - acc: 0.8398 - val_loss: 1.1389 - val_acc: 0.7866\n",
      "Epoch 29/50\n",
      "112720/112720 [==============================] - 2s - loss: 0.4511 - acc: 0.8410 - val_loss: 1.1318 - val_acc: 0.7870\n",
      "Epoch 30/50\n",
      "112720/112720 [==============================] - 2s - loss: 0.4478 - acc: 0.8424 - val_loss: 1.1196 - val_acc: 0.7875\n",
      "Epoch 31/50\n",
      "112720/112720 [==============================] - 2s - loss: 0.4447 - acc: 0.8434 - val_loss: 1.1109 - val_acc: 0.7871\n",
      "Epoch 32/50\n",
      "112720/112720 [==============================] - 2s - loss: 0.4415 - acc: 0.8447 - val_loss: 1.1020 - val_acc: 0.7897\n",
      "Epoch 33/50\n",
      "112720/112720 [==============================] - 2s - loss: 0.4386 - acc: 0.8445 - val_loss: 1.0939 - val_acc: 0.7882\n",
      "Epoch 34/50\n",
      "112720/112720 [==============================] - 2s - loss: 0.4356 - acc: 0.8465 - val_loss: 1.0826 - val_acc: 0.7886\n",
      "Epoch 35/50\n",
      "112720/112720 [==============================] - 2s - loss: 0.4328 - acc: 0.8467 - val_loss: 1.0797 - val_acc: 0.7875\n",
      "Epoch 36/50\n",
      "112720/112720 [==============================] - 2s - loss: 0.4302 - acc: 0.8465 - val_loss: 1.0687 - val_acc: 0.7887\n",
      "Epoch 37/50\n",
      "112720/112720 [==============================] - 2s - loss: 0.4279 - acc: 0.8468 - val_loss: 1.0655 - val_acc: 0.7885\n",
      "Epoch 38/50\n",
      "112720/112720 [==============================] - 2s - loss: 0.4255 - acc: 0.8474 - val_loss: 1.0529 - val_acc: 0.7890\n",
      "Epoch 39/50\n",
      "112720/112720 [==============================] - 2s - loss: 0.4231 - acc: 0.8478 - val_loss: 1.0476 - val_acc: 0.7897\n",
      "Epoch 40/50\n",
      "112720/112720 [==============================] - 2s - loss: 0.4209 - acc: 0.8477 - val_loss: 1.0395 - val_acc: 0.7904\n",
      "Epoch 41/50\n",
      "112720/112720 [==============================] - 2s - loss: 0.4187 - acc: 0.8491 - val_loss: 1.0336 - val_acc: 0.7909\n",
      "Epoch 42/50\n",
      "112720/112720 [==============================] - 2s - loss: 0.4168 - acc: 0.8491 - val_loss: 1.0331 - val_acc: 0.7916\n",
      "Epoch 43/50\n",
      "112720/112720 [==============================] - 2s - loss: 0.4149 - acc: 0.8486 - val_loss: 1.0197 - val_acc: 0.7922\n",
      "Epoch 44/50\n",
      "112720/112720 [==============================] - 2s - loss: 0.4128 - acc: 0.8492 - val_loss: 1.0156 - val_acc: 0.7934\n",
      "Epoch 45/50\n",
      "112720/112720 [==============================] - 2s - loss: 0.4107 - acc: 0.8497 - val_loss: 1.0087 - val_acc: 0.7938\n",
      "Epoch 46/50\n",
      "112720/112720 [==============================] - 2s - loss: 0.4088 - acc: 0.8505 - val_loss: 1.0049 - val_acc: 0.7944\n",
      "Epoch 47/50\n",
      "112720/112720 [==============================] - 2s - loss: 0.4072 - acc: 0.8511 - val_loss: 0.9993 - val_acc: 0.7938\n",
      "Epoch 48/50\n",
      "112720/112720 [==============================] - 2s - loss: 0.4055 - acc: 0.8516 - val_loss: 0.9967 - val_acc: 0.7955\n",
      "Epoch 49/50\n",
      "112720/112720 [==============================] - 2s - loss: 0.4036 - acc: 0.8513 - val_loss: 0.9894 - val_acc: 0.7952\n",
      "Epoch 50/50\n",
      "112720/112720 [==============================] - 2s - loss: 0.4021 - acc: 0.8522 - val_loss: 0.9829 - val_acc: 0.7952\n",
      "22544/22544 [==============================] - 0s     \n",
      "\n",
      " Train Acc: 0.8536195829510689, Test Acc: 0.7951561436057091\n",
      " \n",
      " Current Layer Attributes - epochs:50 hidden layers:6 features count:8\n",
      "Train on 112720 samples, validate on 22544 samples\n",
      "Epoch 1/50\n",
      "112720/112720 [==============================] - 4s - loss: 0.9430 - acc: 0.0196 - val_loss: 1.8978 - val_acc: 0.0083\n",
      "Epoch 2/50\n",
      "112720/112720 [==============================] - 2s - loss: 1.1202 - acc: 0.0870 - val_loss: 1.9139 - val_acc: 0.0222\n",
      "Epoch 3/50\n",
      "112720/112720 [==============================] - 2s - loss: 0.8570 - acc: 0.0244 - val_loss: 1.8578 - val_acc: 0.0363\n",
      "Epoch 4/50\n",
      "112720/112720 [==============================] - 2s - loss: 0.8242 - acc: 0.0443 - val_loss: 1.8342 - val_acc: 0.0465\n",
      "Epoch 5/50\n",
      "112720/112720 [==============================] - 2s - loss: 0.8077 - acc: 0.0561 - val_loss: 1.8194 - val_acc: 0.0659\n",
      "Epoch 6/50\n",
      "112720/112720 [==============================] - 2s - loss: 0.7965 - acc: 0.0666 - val_loss: 1.8085 - val_acc: 0.0877\n",
      "Epoch 7/50\n",
      "112720/112720 [==============================] - 2s - loss: 0.7873 - acc: 0.1171 - val_loss: 1.7994 - val_acc: 0.0815\n",
      "Epoch 8/50\n",
      "112720/112720 [==============================] - 2s - loss: 0.7784 - acc: 0.2253 - val_loss: 1.7892 - val_acc: 0.3389\n",
      "Epoch 9/50\n",
      "112720/112720 [==============================] - 2s - loss: 0.7692 - acc: 0.3597 - val_loss: 1.7799 - val_acc: 0.3550\n",
      "Epoch 10/50\n",
      "112720/112720 [==============================] - 2s - loss: 0.7598 - acc: 0.3926 - val_loss: 1.7690 - val_acc: 0.3920\n",
      "Epoch 11/50\n",
      "112720/112720 [==============================] - 2s - loss: 0.7505 - acc: 0.4263 - val_loss: 1.7579 - val_acc: 0.4110\n",
      "Epoch 12/50\n",
      "112720/112720 [==============================] - 2s - loss: 0.7423 - acc: 0.4570 - val_loss: 1.7480 - val_acc: 0.4292\n",
      "Epoch 13/50\n",
      "112720/112720 [==============================] - 2s - loss: 0.7345 - acc: 0.4826 - val_loss: 1.7387 - val_acc: 0.4421\n",
      "Epoch 14/50\n"
     ]
    },
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "112720/112720 [==============================] - 2s - loss: 0.7273 - acc: 0.4920 - val_loss: 1.7322 - val_acc: 0.4470\n",
      "Epoch 15/50\n",
      "112720/112720 [==============================] - 2s - loss: 0.7209 - acc: 0.4956 - val_loss: 1.7245 - val_acc: 0.4507\n",
      "Epoch 16/50\n",
      "112720/112720 [==============================] - 2s - loss: 0.7143 - acc: 0.4972 - val_loss: 1.7144 - val_acc: 0.4543\n",
      "Epoch 17/50\n",
      "112720/112720 [==============================] - 2s - loss: 0.7082 - acc: 0.5022 - val_loss: 1.7067 - val_acc: 0.4592\n",
      "Epoch 18/50\n",
      "112720/112720 [==============================] - 1s - loss: 0.7020 - acc: 0.5078 - val_loss: 1.6968 - val_acc: 0.4768\n",
      "Epoch 19/50\n",
      "112720/112720 [==============================] - 1s - loss: 0.6956 - acc: 0.5186 - val_loss: 1.6902 - val_acc: 0.4888\n",
      "Epoch 20/50\n",
      "112720/112720 [==============================] - 2s - loss: 0.6893 - acc: 0.5268 - val_loss: 1.6811 - val_acc: 0.4930\n",
      "Epoch 21/50\n",
      "112720/112720 [==============================] - 2s - loss: 0.6831 - acc: 0.5356 - val_loss: 1.6718 - val_acc: 0.5034\n",
      "Epoch 22/50\n",
      "112720/112720 [==============================] - 2s - loss: 0.6772 - acc: 0.5389 - val_loss: 1.6628 - val_acc: 0.4992\n",
      "Epoch 23/50\n",
      "112720/112720 [==============================] - 2s - loss: 0.6714 - acc: 0.5399 - val_loss: 1.6557 - val_acc: 0.5114\n",
      "Epoch 24/50\n",
      "112720/112720 [==============================] - 2s - loss: 0.6659 - acc: 0.5423 - val_loss: 1.6467 - val_acc: 0.5145\n",
      "Epoch 25/50\n",
      "112720/112720 [==============================] - 2s - loss: 0.6609 - acc: 0.5446 - val_loss: 1.6386 - val_acc: 0.5153\n",
      "Epoch 26/50\n",
      "112720/112720 [==============================] - 2s - loss: 0.6561 - acc: 0.5464 - val_loss: 1.6303 - val_acc: 0.5192\n",
      "Epoch 27/50\n",
      "112720/112720 [==============================] - 2s - loss: 0.6514 - acc: 0.5493 - val_loss: 1.6231 - val_acc: 0.5210\n",
      "Epoch 28/50\n",
      "112720/112720 [==============================] - 2s - loss: 0.6471 - acc: 0.5522 - val_loss: 1.6170 - val_acc: 0.5216\n",
      "Epoch 29/50\n",
      "112720/112720 [==============================] - 2s - loss: 0.6428 - acc: 0.5586 - val_loss: 1.6103 - val_acc: 0.5230\n",
      "Epoch 30/50\n",
      "112720/112720 [==============================] - 2s - loss: 0.6388 - acc: 0.5609 - val_loss: 1.6030 - val_acc: 0.5257\n",
      "Epoch 31/50\n",
      "112720/112720 [==============================] - 2s - loss: 0.6351 - acc: 0.5689 - val_loss: 1.5967 - val_acc: 0.5318\n",
      "Epoch 32/50\n",
      "112720/112720 [==============================] - 2s - loss: 0.6312 - acc: 0.5841 - val_loss: 1.5926 - val_acc: 0.5448\n",
      "Epoch 33/50\n",
      "112720/112720 [==============================] - 2s - loss: 0.6276 - acc: 0.6061 - val_loss: 1.5843 - val_acc: 0.5579\n",
      "Epoch 34/50\n",
      "112720/112720 [==============================] - 2s - loss: 0.6242 - acc: 0.6270 - val_loss: 1.5791 - val_acc: 0.5614\n",
      "Epoch 35/50\n",
      "112720/112720 [==============================] - 2s - loss: 0.6209 - acc: 0.6414 - val_loss: 1.5730 - val_acc: 0.5676\n",
      "Epoch 36/50\n",
      "112720/112720 [==============================] - 2s - loss: 0.6175 - acc: 0.6524 - val_loss: 1.5668 - val_acc: 0.5779\n",
      "Epoch 37/50\n",
      "112720/112720 [==============================] - 2s - loss: 0.6142 - acc: 0.6690 - val_loss: 1.5629 - val_acc: 0.5803\n",
      "Epoch 38/50\n",
      "112720/112720 [==============================] - 2s - loss: 0.6113 - acc: 0.6770 - val_loss: 1.5556 - val_acc: 0.5860\n",
      "Epoch 39/50\n",
      "112720/112720 [==============================] - 2s - loss: 0.6082 - acc: 0.6820 - val_loss: 1.5515 - val_acc: 0.5850\n",
      "Epoch 40/50\n",
      "112720/112720 [==============================] - 2s - loss: 0.6053 - acc: 0.6847 - val_loss: 1.5464 - val_acc: 0.5857\n",
      "Epoch 41/50\n",
      "112720/112720 [==============================] - 2s - loss: 0.6024 - acc: 0.6899 - val_loss: 1.5417 - val_acc: 0.5859\n",
      "Epoch 42/50\n",
      "112720/112720 [==============================] - 2s - loss: 0.5996 - acc: 0.6945 - val_loss: 1.5368 - val_acc: 0.5925\n",
      "Epoch 43/50\n",
      "112720/112720 [==============================] - 2s - loss: 0.5968 - acc: 0.6972 - val_loss: 1.5312 - val_acc: 0.5925\n",
      "Epoch 44/50\n",
      "112720/112720 [==============================] - 2s - loss: 0.5941 - acc: 0.6962 - val_loss: 1.5265 - val_acc: 0.5946\n",
      "Epoch 45/50\n",
      "112720/112720 [==============================] - 2s - loss: 0.5915 - acc: 0.6976 - val_loss: 1.5208 - val_acc: 0.5957\n",
      "Epoch 46/50\n",
      "112720/112720 [==============================] - 2s - loss: 0.5890 - acc: 0.6986 - val_loss: 1.5163 - val_acc: 0.5998\n",
      "Epoch 47/50\n",
      "112720/112720 [==============================] - 2s - loss: 0.5865 - acc: 0.6998 - val_loss: 1.5118 - val_acc: 0.6014\n",
      "Epoch 48/50\n",
      "112720/112720 [==============================] - 2s - loss: 0.5841 - acc: 0.7003 - val_loss: 1.5059 - val_acc: 0.6011\n",
      "Epoch 49/50\n",
      "112720/112720 [==============================] - 2s - loss: 0.5816 - acc: 0.7005 - val_loss: 1.5013 - val_acc: 0.6080\n",
      "Epoch 50/50\n",
      "112720/112720 [==============================] - 2s - loss: 0.5792 - acc: 0.7007 - val_loss: 1.4968 - val_acc: 0.5987\n",
      "22544/22544 [==============================] - 0s     \n",
      "\n",
      " Train Acc: 0.6971256211400032, Test Acc: 0.5987402386963367\n",
      " \n",
      " Current Layer Attributes - epochs:50 hidden layers:6 features count:16\n",
      "Train on 112720 samples, validate on 22544 samples\n",
      "Epoch 1/50\n",
      "112720/112720 [==============================] - 3s - loss: 0.9889 - acc: 0.0015 - val_loss: 1.9490 - val_acc: 0.0000e+00\n",
      "Epoch 2/50\n",
      "112720/112720 [==============================] - 2s - loss: 0.8993 - acc: 0.0024 - val_loss: 1.9000 - val_acc: 4.8793e-04\n",
      "Epoch 3/50\n",
      "112720/112720 [==============================] - 2s - loss: 0.8538 - acc: 0.0248 - val_loss: 1.8448 - val_acc: 0.0186\n",
      "Epoch 4/50\n",
      "112720/112720 [==============================] - 2s - loss: 0.8235 - acc: 0.0865 - val_loss: 1.8143 - val_acc: 0.0731\n",
      "Epoch 5/50\n",
      "112720/112720 [==============================] - 2s - loss: 0.7913 - acc: 0.1624 - val_loss: 1.7794 - val_acc: 0.2981\n",
      "Epoch 6/50\n",
      "112720/112720 [==============================] - 2s - loss: 0.7585 - acc: 0.3923 - val_loss: 1.7435 - val_acc: 0.4763\n",
      "Epoch 7/50\n",
      "112720/112720 [==============================] - 2s - loss: 0.7293 - acc: 0.4687 - val_loss: 1.7169 - val_acc: 0.5421\n",
      "Epoch 8/50\n",
      "112720/112720 [==============================] - 2s - loss: 0.7095 - acc: 0.5058 - val_loss: 1.6881 - val_acc: 0.5489\n",
      "Epoch 9/50\n",
      "112720/112720 [==============================] - 2s - loss: 0.6927 - acc: 0.5161 - val_loss: 1.6751 - val_acc: 0.5584\n",
      "Epoch 10/50\n",
      "112720/112720 [==============================] - 2s - loss: 0.6799 - acc: 0.5295 - val_loss: 1.6513 - val_acc: 0.5786\n",
      "Epoch 11/50\n",
      "112720/112720 [==============================] - 2s - loss: 0.6677 - acc: 0.5447 - val_loss: 1.6413 - val_acc: 0.6543\n",
      "Epoch 12/50\n",
      "112720/112720 [==============================] - 2s - loss: 0.6569 - acc: 0.5603 - val_loss: 1.6283 - val_acc: 0.6593\n",
      "Epoch 13/50\n",
      "112720/112720 [==============================] - 2s - loss: 0.6473 - acc: 0.5780 - val_loss: 1.6148 - val_acc: 0.6652\n",
      "Epoch 14/50\n",
      "112720/112720 [==============================] - 2s - loss: 0.6383 - acc: 0.5930 - val_loss: 1.6009 - val_acc: 0.6662\n",
      "Epoch 15/50\n",
      "112720/112720 [==============================] - 2s - loss: 0.6299 - acc: 0.6019 - val_loss: 1.5889 - val_acc: 0.6689\n",
      "Epoch 16/50\n",
      "112720/112720 [==============================] - 2s - loss: 0.6220 - acc: 0.6109 - val_loss: 1.5757 - val_acc: 0.6726\n",
      "Epoch 17/50\n",
      "112720/112720 [==============================] - 2s - loss: 0.6148 - acc: 0.6230 - val_loss: 1.5639 - val_acc: 0.6794\n",
      "Epoch 18/50\n",
      "112720/112720 [==============================] - 2s - loss: 0.6080 - acc: 0.6347 - val_loss: 1.5533 - val_acc: 0.6773\n",
      "Epoch 19/50\n",
      "112720/112720 [==============================] - 2s - loss: 0.6014 - acc: 0.6414 - val_loss: 1.5447 - val_acc: 0.6804\n",
      "Epoch 20/50\n",
      "112720/112720 [==============================] - 2s - loss: 0.5952 - acc: 0.6466 - val_loss: 1.5342 - val_acc: 0.6808\n",
      "Epoch 21/50\n",
      "112720/112720 [==============================] - 2s - loss: 0.5894 - acc: 0.6522 - val_loss: 1.5250 - val_acc: 0.6828\n",
      "Epoch 22/50\n",
      "112720/112720 [==============================] - 2s - loss: 0.5838 - acc: 0.6577 - val_loss: 1.5148 - val_acc: 0.6823\n",
      "Epoch 23/50\n",
      "112720/112720 [==============================] - 2s - loss: 0.5786 - acc: 0.6597 - val_loss: 1.5080 - val_acc: 0.6844\n",
      "Epoch 24/50\n",
      "112720/112720 [==============================] - 1s - loss: 0.5737 - acc: 0.6631 - val_loss: 1.4986 - val_acc: 0.6850\n",
      "Epoch 25/50\n"
     ]
    },
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "112720/112720 [==============================] - 1s - loss: 0.5691 - acc: 0.6659 - val_loss: 1.4890 - val_acc: 0.6896\n",
      "Epoch 26/50\n",
      "112720/112720 [==============================] - 1s - loss: 0.5646 - acc: 0.6720 - val_loss: 1.4817 - val_acc: 0.6906\n",
      "Epoch 27/50\n",
      "112720/112720 [==============================] - 2s - loss: 0.5603 - acc: 0.6746 - val_loss: 1.4736 - val_acc: 0.6930\n",
      "Epoch 28/50\n",
      "112720/112720 [==============================] - 2s - loss: 0.5561 - acc: 0.6761 - val_loss: 1.4651 - val_acc: 0.6988\n",
      "Epoch 29/50\n",
      "112720/112720 [==============================] - 2s - loss: 0.5523 - acc: 0.6798 - val_loss: 1.4586 - val_acc: 0.7016\n",
      "Epoch 30/50\n",
      "112720/112720 [==============================] - 2s - loss: 0.5484 - acc: 0.6828 - val_loss: 1.4564 - val_acc: 0.7017\n",
      "Epoch 31/50\n",
      "112720/112720 [==============================] - 2s - loss: 0.5451 - acc: 0.6872 - val_loss: 1.4451 - val_acc: 0.7064\n",
      "Epoch 32/50\n",
      "112720/112720 [==============================] - 2s - loss: 0.5415 - acc: 0.6927 - val_loss: 1.4398 - val_acc: 0.7041\n",
      "Epoch 33/50\n",
      "112720/112720 [==============================] - 2s - loss: 0.5383 - acc: 0.6934 - val_loss: 1.4333 - val_acc: 0.7087\n",
      "Epoch 34/50\n",
      "112720/112720 [==============================] - 2s - loss: 0.5353 - acc: 0.6965 - val_loss: 1.4280 - val_acc: 0.7076\n",
      "Epoch 35/50\n",
      "112720/112720 [==============================] - 2s - loss: 0.5320 - acc: 0.7000 - val_loss: 1.4225 - val_acc: 0.7119\n",
      "Epoch 36/50\n",
      "112720/112720 [==============================] - 2s - loss: 0.5292 - acc: 0.7046 - val_loss: 1.4156 - val_acc: 0.7128\n",
      "Epoch 37/50\n",
      "112720/112720 [==============================] - 2s - loss: 0.5263 - acc: 0.7084 - val_loss: 1.4106 - val_acc: 0.7156\n",
      "Epoch 38/50\n",
      "112720/112720 [==============================] - 2s - loss: 0.5237 - acc: 0.7097 - val_loss: 1.4051 - val_acc: 0.7111\n",
      "Epoch 39/50\n",
      "112720/112720 [==============================] - 2s - loss: 0.5211 - acc: 0.7117 - val_loss: 1.4024 - val_acc: 0.7164\n",
      "Epoch 40/50\n",
      "112720/112720 [==============================] - 2s - loss: 0.5184 - acc: 0.7125 - val_loss: 1.3963 - val_acc: 0.7167\n",
      "Epoch 41/50\n",
      "112720/112720 [==============================] - 2s - loss: 0.5161 - acc: 0.7134 - val_loss: 1.3902 - val_acc: 0.7281\n",
      "Epoch 42/50\n",
      "112720/112720 [==============================] - 2s - loss: 0.5138 - acc: 0.7164 - val_loss: 1.3849 - val_acc: 0.7295\n",
      "Epoch 43/50\n",
      "112720/112720 [==============================] - 2s - loss: 0.5115 - acc: 0.7258 - val_loss: 1.3826 - val_acc: 0.7302\n",
      "Epoch 44/50\n",
      "112720/112720 [==============================] - 2s - loss: 0.5093 - acc: 0.7231 - val_loss: 1.3793 - val_acc: 0.7294\n",
      "Epoch 45/50\n",
      "112720/112720 [==============================] - 2s - loss: 0.5074 - acc: 0.7254 - val_loss: 1.3752 - val_acc: 0.7353\n",
      "Epoch 46/50\n",
      "112720/112720 [==============================] - 2s - loss: 0.5052 - acc: 0.7281 - val_loss: 1.3686 - val_acc: 0.7763\n",
      "Epoch 47/50\n",
      "112720/112720 [==============================] - 2s - loss: 0.5031 - acc: 0.7364 - val_loss: 1.3658 - val_acc: 0.7428\n",
      "Epoch 48/50\n",
      "112720/112720 [==============================] - 2s - loss: 0.5012 - acc: 0.7329 - val_loss: 1.3606 - val_acc: 0.7381\n",
      "Epoch 49/50\n",
      "112720/112720 [==============================] - 2s - loss: 0.4992 - acc: 0.7326 - val_loss: 1.3583 - val_acc: 0.7394\n",
      "Epoch 50/50\n",
      "112720/112720 [==============================] - 2s - loss: 0.4975 - acc: 0.7400 - val_loss: 1.3533 - val_acc: 0.7441\n",
      "22544/22544 [==============================] - 0s     \n",
      "\n",
      " Train Acc: 0.7272888571023941, Test Acc: 0.7440560720860958\n",
      " \n",
      " Current Layer Attributes - epochs:50 hidden layers:6 features count:32\n",
      "Train on 112720 samples, validate on 22544 samples\n",
      "Epoch 1/50\n",
      "112720/112720 [==============================] - 3s - loss: 18545.4220 - acc: 0.0195 - val_loss: 16.9070 - val_acc: 0.0076\n",
      "Epoch 2/50\n",
      "112720/112720 [==============================] - 2s - loss: 1542616.8398 - acc: 0.0265 - val_loss: 1.8890 - val_acc: 0.0083\n",
      "Epoch 3/50\n",
      "112720/112720 [==============================] - 2s - loss: 4.5241 - acc: 0.0042 - val_loss: 1.8595 - val_acc: 0.0266\n",
      "Epoch 4/50\n",
      "112720/112720 [==============================] - 2s - loss: 0.8350 - acc: 0.0055 - val_loss: 1.8324 - val_acc: 0.0500\n",
      "Epoch 5/50\n",
      "112720/112720 [==============================] - 2s - loss: 0.8161 - acc: 0.0099 - val_loss: 1.8219 - val_acc: 0.0533\n",
      "Epoch 6/50\n",
      "112720/112720 [==============================] - 2s - loss: 0.8031 - acc: 0.0465 - val_loss: 1.8106 - val_acc: 0.0848\n",
      "Epoch 7/50\n",
      "112720/112720 [==============================] - 2s - loss: 0.7939 - acc: 0.1140 - val_loss: 1.8015 - val_acc: 0.1041\n",
      "Epoch 8/50\n",
      "112720/112720 [==============================] - 2s - loss: 0.7871 - acc: 0.1229 - val_loss: 1.7945 - val_acc: 0.0961\n",
      "Epoch 9/50\n",
      "112720/112720 [==============================] - 2s - loss: 0.7795 - acc: 0.1240 - val_loss: 1.7882 - val_acc: 0.0805\n",
      "Epoch 10/50\n",
      "112720/112720 [==============================] - 2s - loss: 0.7727 - acc: 0.1250 - val_loss: 1.7824 - val_acc: 0.0804\n",
      "Epoch 11/50\n",
      "112720/112720 [==============================] - 2s - loss: 0.7667 - acc: 0.1259 - val_loss: 1.7779 - val_acc: 0.0800\n",
      "Epoch 12/50\n",
      "112720/112720 [==============================] - 2s - loss: 0.7637 - acc: 0.1264 - val_loss: 1.7745 - val_acc: 0.0800\n",
      "Epoch 13/50\n",
      "112720/112720 [==============================] - 2s - loss: 0.7583 - acc: 0.1277 - val_loss: 1.7715 - val_acc: 0.0793\n",
      "Epoch 14/50\n",
      "112720/112720 [==============================] - 2s - loss: 0.7552 - acc: 0.1290 - val_loss: 1.7711 - val_acc: 0.0798\n",
      "Epoch 15/50\n",
      "112720/112720 [==============================] - 2s - loss: 0.7518 - acc: 0.1292 - val_loss: 1.7672 - val_acc: 0.0794\n",
      "Epoch 16/50\n",
      "112720/112720 [==============================] - 2s - loss: 0.7483 - acc: 0.1305 - val_loss: 1.7663 - val_acc: 0.0793\n",
      "Epoch 17/50\n",
      "112720/112720 [==============================] - 2s - loss: 0.7451 - acc: 0.1323 - val_loss: 1.7601 - val_acc: 0.0797\n",
      "Epoch 18/50\n",
      "112720/112720 [==============================] - 2s - loss: 0.7421 - acc: 0.1350 - val_loss: 1.7589 - val_acc: 0.0800\n",
      "Epoch 19/50\n",
      "112720/112720 [==============================] - 2s - loss: 0.7398 - acc: 0.1363 - val_loss: 1.7561 - val_acc: 0.0803\n",
      "Epoch 20/50\n",
      "112720/112720 [==============================] - 2s - loss: 0.7384 - acc: 0.1371 - val_loss: 1.7573 - val_acc: 0.0804\n",
      "Epoch 21/50\n",
      "112720/112720 [==============================] - 2s - loss: 0.7350 - acc: 0.1376 - val_loss: 1.7520 - val_acc: 0.0801\n",
      "Epoch 22/50\n",
      "112720/112720 [==============================] - 2s - loss: 0.7324 - acc: 0.1373 - val_loss: 1.7503 - val_acc: 0.0798\n",
      "Epoch 23/50\n",
      "112720/112720 [==============================] - 2s - loss: 0.7301 - acc: 0.1373 - val_loss: 1.7490 - val_acc: 0.0802\n",
      "Epoch 24/50\n",
      "112720/112720 [==============================] - 2s - loss: 0.7279 - acc: 0.1377 - val_loss: 1.7461 - val_acc: 0.0798\n",
      "Epoch 25/50\n",
      "112720/112720 [==============================] - 2s - loss: 0.7258 - acc: 0.1400 - val_loss: 1.7426 - val_acc: 0.0799\n",
      "Epoch 26/50\n",
      "112720/112720 [==============================] - 2s - loss: 0.7229 - acc: 0.1434 - val_loss: 1.7421 - val_acc: 0.0804\n",
      "Epoch 27/50\n",
      "112720/112720 [==============================] - 2s - loss: 0.7215 - acc: 0.1469 - val_loss: 1.7394 - val_acc: 0.0814\n",
      "Epoch 28/50\n",
      "112720/112720 [==============================] - 2s - loss: 0.7193 - acc: 0.1488 - val_loss: 1.7380 - val_acc: 0.0808\n",
      "Epoch 29/50\n",
      "112720/112720 [==============================] - 2s - loss: 0.7172 - acc: 0.1513 - val_loss: 1.7355 - val_acc: 0.0845\n",
      "Epoch 30/50\n",
      "112720/112720 [==============================] - 2s - loss: 0.7153 - acc: 0.1554 - val_loss: 1.7319 - val_acc: 0.0885\n",
      "Epoch 31/50\n",
      "112720/112720 [==============================] - 1s - loss: 0.7141 - acc: 0.1608 - val_loss: 1.7290 - val_acc: 0.0908\n",
      "Epoch 32/50\n",
      "112720/112720 [==============================] - 1s - loss: 0.7115 - acc: 0.1647 - val_loss: 1.7273 - val_acc: 0.0924\n",
      "Epoch 33/50\n",
      "112720/112720 [==============================] - 1s - loss: 0.7099 - acc: 0.1677 - val_loss: 1.7243 - val_acc: 0.0955\n",
      "Epoch 34/50\n",
      "112720/112720 [==============================] - 2s - loss: 0.7131 - acc: 0.1716 - val_loss: 1.7221 - val_acc: 0.0987\n",
      "Epoch 35/50\n",
      "112720/112720 [==============================] - 2s - loss: 0.7078 - acc: 0.1740 - val_loss: 1.7215 - val_acc: 0.1048\n",
      "Epoch 36/50\n"
     ]
    },
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "112720/112720 [==============================] - 2s - loss: 0.7056 - acc: 0.1775 - val_loss: 1.7222 - val_acc: 0.1092\n",
      "Epoch 37/50\n",
      "112720/112720 [==============================] - 2s - loss: 0.7038 - acc: 0.1822 - val_loss: 1.7213 - val_acc: 0.1132\n",
      "Epoch 38/50\n",
      "112720/112720 [==============================] - 2s - loss: 0.7045 - acc: 0.1867 - val_loss: 1.7190 - val_acc: 0.1164\n",
      "Epoch 39/50\n",
      "112720/112720 [==============================] - 2s - loss: 0.7031 - acc: 0.1916 - val_loss: 1.7164 - val_acc: 0.1263\n",
      "Epoch 40/50\n",
      "112720/112720 [==============================] - 2s - loss: 0.7011 - acc: 0.1963 - val_loss: 1.7132 - val_acc: 0.1337\n",
      "Epoch 41/50\n",
      "112720/112720 [==============================] - 2s - loss: 0.6995 - acc: 0.2008 - val_loss: 1.7134 - val_acc: 0.1467\n",
      "Epoch 42/50\n",
      "112720/112720 [==============================] - 2s - loss: 0.6973 - acc: 0.2060 - val_loss: 1.7102 - val_acc: 0.1566\n",
      "Epoch 43/50\n",
      "112720/112720 [==============================] - 2s - loss: 0.6975 - acc: 0.2127 - val_loss: 1.7083 - val_acc: 0.1589\n",
      "Epoch 44/50\n",
      "112720/112720 [==============================] - 2s - loss: 0.6952 - acc: 0.2163 - val_loss: 1.7063 - val_acc: 0.1649\n",
      "Epoch 45/50\n",
      "112720/112720 [==============================] - 2s - loss: 0.6939 - acc: 0.2194 - val_loss: 1.7044 - val_acc: 0.1682\n",
      "Epoch 46/50\n",
      "112720/112720 [==============================] - 2s - loss: 0.6921 - acc: 0.2214 - val_loss: 1.7026 - val_acc: 0.1712\n",
      "Epoch 47/50\n",
      "112720/112720 [==============================] - 2s - loss: 0.6910 - acc: 0.2240 - val_loss: 1.7017 - val_acc: 0.1745\n",
      "Epoch 48/50\n",
      "112720/112720 [==============================] - 2s - loss: 0.6917 - acc: 0.2273 - val_loss: 1.7008 - val_acc: 0.1779\n",
      "Epoch 49/50\n",
      "112720/112720 [==============================] - 2s - loss: 0.6911 - acc: 0.2324 - val_loss: 1.6994 - val_acc: 0.1831\n",
      "Epoch 50/50\n",
      "112720/112720 [==============================] - 2s - loss: 0.6886 - acc: 0.2385 - val_loss: 1.6981 - val_acc: 0.1894\n",
      "21135/22544 [===========================>..] - ETA: 0s\n",
      " Train Acc: 0.24751597084105015, Test Acc: 0.18940738029778004\n",
      " \n",
      " Current Layer Attributes - epochs:50 hidden layers:10 features count:2\n",
      "Train on 112720 samples, validate on 22544 samples\n",
      "Epoch 1/50\n",
      "112720/112720 [==============================] - 4s - loss: 0.9873 - acc: 0.0035 - val_loss: 1.9632 - val_acc: 0.0000e+00\n",
      "Epoch 2/50\n",
      "112720/112720 [==============================] - 3s - loss: 0.9101 - acc: 0.0034 - val_loss: 1.8951 - val_acc: 0.0012\n",
      "Epoch 3/50\n",
      "112720/112720 [==============================] - 3s - loss: 0.8576 - acc: 0.0019 - val_loss: 1.8471 - val_acc: 0.0037\n",
      "Epoch 4/50\n",
      "112720/112720 [==============================] - 3s - loss: 0.8293 - acc: 0.0233 - val_loss: 1.8369 - val_acc: 0.0404\n",
      "Epoch 5/50\n",
      "112720/112720 [==============================] - 3s - loss: 0.8086 - acc: 0.0350 - val_loss: 1.8185 - val_acc: 0.0423\n",
      "Epoch 6/50\n",
      "112720/112720 [==============================] - 3s - loss: 0.7940 - acc: 0.0453 - val_loss: 1.8107 - val_acc: 0.0566\n",
      "Epoch 7/50\n",
      "112720/112720 [==============================] - 3s - loss: 0.7803 - acc: 0.2166 - val_loss: 1.8042 - val_acc: 0.3460\n",
      "Epoch 8/50\n",
      "112720/112720 [==============================] - 3s - loss: 0.7686 - acc: 0.3749 - val_loss: 1.7936 - val_acc: 0.3999\n",
      "Epoch 9/50\n",
      "112720/112720 [==============================] - 3s - loss: 0.7580 - acc: 0.4227 - val_loss: 1.7865 - val_acc: 0.4367\n",
      "Epoch 10/50\n",
      "112720/112720 [==============================] - 3s - loss: 0.7485 - acc: 0.4660 - val_loss: 1.7829 - val_acc: 0.4693\n",
      "Epoch 11/50\n",
      "112720/112720 [==============================] - 3s - loss: 0.7402 - acc: 0.4881 - val_loss: 1.7731 - val_acc: 0.4995\n",
      "Epoch 12/50\n",
      "112720/112720 [==============================] - 3s - loss: 0.7323 - acc: 0.5053 - val_loss: 1.7670 - val_acc: 0.5953\n",
      "Epoch 13/50\n",
      "112720/112720 [==============================] - 3s - loss: 0.7243 - acc: 0.5180 - val_loss: 1.7617 - val_acc: 0.5984\n",
      "Epoch 14/50\n",
      "112720/112720 [==============================] - 3s - loss: 0.7177 - acc: 0.5223 - val_loss: 1.7599 - val_acc: 0.6008\n",
      "Epoch 15/50\n",
      "112720/112720 [==============================] - 3s - loss: 0.7114 - acc: 0.5351 - val_loss: 1.7510 - val_acc: 0.6066\n",
      "Epoch 16/50\n",
      "112720/112720 [==============================] - 3s - loss: 0.7061 - acc: 0.5458 - val_loss: 1.7492 - val_acc: 0.6100\n",
      "Epoch 17/50\n",
      "112720/112720 [==============================] - 3s - loss: 0.7008 - acc: 0.5570 - val_loss: 1.7444 - val_acc: 0.6103\n",
      "Epoch 18/50\n",
      "112720/112720 [==============================] - 3s - loss: 0.6964 - acc: 0.5686 - val_loss: 1.7405 - val_acc: 0.6106\n",
      "Epoch 19/50\n",
      "112720/112720 [==============================] - 3s - loss: 0.6925 - acc: 0.5785 - val_loss: 1.7349 - val_acc: 0.6141\n",
      "Epoch 20/50\n",
      "112720/112720 [==============================] - 3s - loss: 0.6888 - acc: 0.6008 - val_loss: 1.7350 - val_acc: 0.6157\n",
      "Epoch 21/50\n",
      "112720/112720 [==============================] - 3s - loss: 0.6850 - acc: 0.6253 - val_loss: 1.7311 - val_acc: 0.6183\n",
      "Epoch 22/50\n",
      "112720/112720 [==============================] - 3s - loss: 0.6822 - acc: 0.6442 - val_loss: 1.7282 - val_acc: 0.6531\n",
      "Epoch 23/50\n",
      "112720/112720 [==============================] - 3s - loss: 0.6794 - acc: 0.6636 - val_loss: 1.7251 - val_acc: 0.6545\n",
      "Epoch 24/50\n",
      "112720/112720 [==============================] - 3s - loss: 0.6765 - acc: 0.6734 - val_loss: 1.7271 - val_acc: 0.6251\n",
      "Epoch 25/50\n",
      "112720/112720 [==============================] - 3s - loss: 0.6745 - acc: 0.6732 - val_loss: 1.7217 - val_acc: 0.6568\n",
      "Epoch 26/50\n",
      "112720/112720 [==============================] - 2s - loss: 0.6724 - acc: 0.6797 - val_loss: 1.7192 - val_acc: 0.6574\n",
      "Epoch 27/50\n",
      "112720/112720 [==============================] - 2s - loss: 0.6700 - acc: 0.6818 - val_loss: 1.7172 - val_acc: 0.6579\n",
      "Epoch 28/50\n",
      "112720/112720 [==============================] - 2s - loss: 0.6684 - acc: 0.6827 - val_loss: 1.7160 - val_acc: 0.6580\n",
      "Epoch 29/50\n",
      "112720/112720 [==============================] - 3s - loss: 0.6662 - acc: 0.6829 - val_loss: 1.7153 - val_acc: 0.6593\n",
      "Epoch 30/50\n",
      "112720/112720 [==============================] - 3s - loss: 0.6644 - acc: 0.6845 - val_loss: 1.7124 - val_acc: 0.6583\n",
      "Epoch 31/50\n",
      "112720/112720 [==============================] - 3s - loss: 0.6624 - acc: 0.6845 - val_loss: 1.7104 - val_acc: 0.6591\n",
      "Epoch 32/50\n",
      "112720/112720 [==============================] - 3s - loss: 0.6607 - acc: 0.6846 - val_loss: 1.7108 - val_acc: 0.6588\n",
      "Epoch 33/50\n",
      "112720/112720 [==============================] - 3s - loss: 0.6591 - acc: 0.6851 - val_loss: 1.7083 - val_acc: 0.6588\n",
      "Epoch 34/50\n",
      "112720/112720 [==============================] - 3s - loss: 0.6575 - acc: 0.6858 - val_loss: 1.7065 - val_acc: 0.6590\n",
      "Epoch 35/50\n",
      "112720/112720 [==============================] - 3s - loss: 0.6558 - acc: 0.6855 - val_loss: 1.7044 - val_acc: 0.6611\n",
      "Epoch 36/50\n",
      "112720/112720 [==============================] - 3s - loss: 0.6543 - acc: 0.6876 - val_loss: 1.7038 - val_acc: 0.6612\n",
      "Epoch 37/50\n",
      "112720/112720 [==============================] - 3s - loss: 0.6531 - acc: 0.6885 - val_loss: 1.7001 - val_acc: 0.6639\n",
      "Epoch 38/50\n",
      "112720/112720 [==============================] - 3s - loss: 0.6515 - acc: 0.6898 - val_loss: 1.7018 - val_acc: 0.6630\n",
      "Epoch 39/50\n",
      "112720/112720 [==============================] - 3s - loss: 0.6502 - acc: 0.6946 - val_loss: 1.6973 - val_acc: 0.6635\n",
      "Epoch 40/50\n",
      "112720/112720 [==============================] - 3s - loss: 0.6487 - acc: 0.6977 - val_loss: 1.6971 - val_acc: 0.6655\n",
      "Epoch 41/50\n",
      "112720/112720 [==============================] - 3s - loss: 0.6475 - acc: 0.7008 - val_loss: 1.6956 - val_acc: 0.6653\n",
      "Epoch 42/50\n",
      "112720/112720 [==============================] - 3s - loss: 0.6460 - acc: 0.7037 - val_loss: 1.6950 - val_acc: 0.6661\n",
      "Epoch 43/50\n",
      "112720/112720 [==============================] - 3s - loss: 0.6451 - acc: 0.7027 - val_loss: 1.6948 - val_acc: 0.6680\n",
      "Epoch 44/50\n",
      "112720/112720 [==============================] - 3s - loss: 0.6435 - acc: 0.7052 - val_loss: 1.6905 - val_acc: 0.6719\n",
      "Epoch 45/50\n",
      "112720/112720 [==============================] - 3s - loss: 0.6426 - acc: 0.7057 - val_loss: 1.6902 - val_acc: 0.6717\n",
      "Epoch 46/50\n",
      "112720/112720 [==============================] - 3s - loss: 0.6414 - acc: 0.7058 - val_loss: 1.6890 - val_acc: 0.6720\n",
      "Epoch 47/50\n"
     ]
    },
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "112720/112720 [==============================] - 3s - loss: 0.6402 - acc: 0.7068 - val_loss: 1.6883 - val_acc: 0.6739\n",
      "Epoch 48/50\n",
      "112720/112720 [==============================] - 3s - loss: 0.6389 - acc: 0.7087 - val_loss: 1.6859 - val_acc: 0.6748\n",
      "Epoch 49/50\n",
      "112720/112720 [==============================] - 3s - loss: 0.6380 - acc: 0.7101 - val_loss: 1.6846 - val_acc: 0.6767\n",
      "Epoch 50/50\n",
      "112720/112720 [==============================] - 3s - loss: 0.6369 - acc: 0.7126 - val_loss: 1.6836 - val_acc: 0.6772\n",
      "22544/22544 [==============================] - 0s     \n",
      "\n",
      " Train Acc: 0.715312272310257, Test Acc: 0.6772090159356594\n",
      " \n",
      " Current Layer Attributes - epochs:50 hidden layers:10 features count:4\n",
      "Train on 112720 samples, validate on 22544 samples\n",
      "Epoch 1/50\n",
      "112720/112720 [==============================] - 5s - loss: 0.9806 - acc: 0.0056 - val_loss: 1.9554 - val_acc: 0.0014\n",
      "Epoch 2/50\n",
      "112720/112720 [==============================] - 3s - loss: 0.9076 - acc: 0.0011 - val_loss: 1.9080 - val_acc: 0.0019\n",
      "Epoch 3/50\n",
      "112720/112720 [==============================] - 3s - loss: 0.8646 - acc: 0.0031 - val_loss: 1.8561 - val_acc: 0.0025\n",
      "Epoch 4/50\n",
      "112720/112720 [==============================] - 3s - loss: 0.8387 - acc: 0.0088 - val_loss: 1.8423 - val_acc: 0.0126\n",
      "Epoch 5/50\n",
      "112720/112720 [==============================] - 3s - loss: 0.8217 - acc: 0.0423 - val_loss: 1.8215 - val_acc: 0.0879\n",
      "Epoch 6/50\n",
      "112720/112720 [==============================] - 3s - loss: 0.8021 - acc: 0.2232 - val_loss: 1.8095 - val_acc: 0.3671\n",
      "Epoch 7/50\n",
      "112720/112720 [==============================] - 3s - loss: 0.7843 - acc: 0.3430 - val_loss: 1.7989 - val_acc: 0.4076\n",
      "Epoch 8/50\n",
      "112720/112720 [==============================] - 3s - loss: 0.7713 - acc: 0.3573 - val_loss: 1.7891 - val_acc: 0.5090\n",
      "Epoch 9/50\n",
      "112720/112720 [==============================] - 3s - loss: 0.7616 - acc: 0.4002 - val_loss: 1.7897 - val_acc: 0.5244\n",
      "Epoch 10/50\n",
      "112720/112720 [==============================] - 3s - loss: 0.7521 - acc: 0.4287 - val_loss: 1.7714 - val_acc: 0.4583\n",
      "Epoch 11/50\n",
      "112720/112720 [==============================] - 3s - loss: 0.7421 - acc: 0.4361 - val_loss: 1.7681 - val_acc: 0.5358\n",
      "Epoch 12/50\n",
      "112720/112720 [==============================] - 3s - loss: 0.7346 - acc: 0.4392 - val_loss: 1.7600 - val_acc: 0.5350\n",
      "Epoch 13/50\n",
      "112720/112720 [==============================] - 3s - loss: 0.7301 - acc: 0.4406 - val_loss: 1.7539 - val_acc: 0.5232\n",
      "Epoch 14/50\n",
      "112720/112720 [==============================] - 3s - loss: 0.7246 - acc: 0.4431 - val_loss: 1.7470 - val_acc: 0.5049\n",
      "Epoch 15/50\n",
      "112720/112720 [==============================] - 2s - loss: 0.7182 - acc: 0.4467 - val_loss: 1.7382 - val_acc: 0.5397\n",
      "Epoch 16/50\n",
      "112720/112720 [==============================] - 2s - loss: 0.7124 - acc: 0.4492 - val_loss: 1.7397 - val_acc: 0.5394\n",
      "Epoch 17/50\n",
      "112720/112720 [==============================] - 2s - loss: 0.7076 - acc: 0.4651 - val_loss: 1.7323 - val_acc: 0.5271\n",
      "Epoch 18/50\n",
      "112720/112720 [==============================] - 2s - loss: 0.7022 - acc: 0.4796 - val_loss: 1.7293 - val_acc: 0.5651\n",
      "Epoch 19/50\n",
      "112720/112720 [==============================] - 3s - loss: 0.6987 - acc: 0.5009 - val_loss: 1.7291 - val_acc: 0.4339\n",
      "Epoch 20/50\n",
      "112720/112720 [==============================] - 3s - loss: 0.6965 - acc: 0.4966 - val_loss: 1.7152 - val_acc: 0.5601\n",
      "Epoch 21/50\n",
      "112720/112720 [==============================] - 3s - loss: 0.6891 - acc: 0.5144 - val_loss: 1.7136 - val_acc: 0.5863\n",
      "Epoch 22/50\n",
      "112720/112720 [==============================] - 3s - loss: 0.6857 - acc: 0.5224 - val_loss: 1.7093 - val_acc: 0.5956\n",
      "Epoch 23/50\n",
      "112720/112720 [==============================] - 3s - loss: 0.6828 - acc: 0.5276 - val_loss: 1.7077 - val_acc: 0.5941\n",
      "Epoch 24/50\n",
      "112720/112720 [==============================] - 3s - loss: 0.6801 - acc: 0.5346 - val_loss: 1.7037 - val_acc: 0.5996\n",
      "Epoch 25/50\n",
      "112720/112720 [==============================] - 3s - loss: 0.6785 - acc: 0.5379 - val_loss: 1.7283 - val_acc: 0.4920\n",
      "Epoch 26/50\n",
      "112720/112720 [==============================] - 3s - loss: 0.6818 - acc: 0.5329 - val_loss: 1.7031 - val_acc: 0.6009\n",
      "Epoch 27/50\n",
      "112720/112720 [==============================] - 3s - loss: 0.6735 - acc: 0.5464 - val_loss: 1.6961 - val_acc: 0.6036\n",
      "Epoch 28/50\n",
      "112720/112720 [==============================] - 3s - loss: 0.6710 - acc: 0.5491 - val_loss: 1.6949 - val_acc: 0.6170\n",
      "Epoch 29/50\n",
      "112720/112720 [==============================] - 3s - loss: 0.6691 - acc: 0.5510 - val_loss: 1.6919 - val_acc: 0.6087\n",
      "Epoch 30/50\n",
      "112720/112720 [==============================] - 3s - loss: 0.6676 - acc: 0.5516 - val_loss: 1.6871 - val_acc: 0.6277\n",
      "Epoch 31/50\n",
      "112720/112720 [==============================] - 3s - loss: 0.6663 - acc: 0.5542 - val_loss: 1.6862 - val_acc: 0.6278\n",
      "Epoch 32/50\n",
      "112720/112720 [==============================] - 3s - loss: 0.6647 - acc: 0.5561 - val_loss: 1.6853 - val_acc: 0.6293\n",
      "Epoch 33/50\n",
      "112720/112720 [==============================] - 3s - loss: 0.6630 - acc: 0.5569 - val_loss: 1.6865 - val_acc: 0.6261\n",
      "Epoch 34/50\n",
      "112720/112720 [==============================] - 3s - loss: 0.6628 - acc: 0.5561 - val_loss: 1.6810 - val_acc: 0.6295\n",
      "Epoch 35/50\n",
      "112720/112720 [==============================] - 3s - loss: 0.6599 - acc: 0.5597 - val_loss: 1.6796 - val_acc: 0.6272\n",
      "Epoch 36/50\n",
      "112720/112720 [==============================] - 3s - loss: 0.6587 - acc: 0.5616 - val_loss: 1.6778 - val_acc: 0.6329\n",
      "Epoch 37/50\n",
      "112720/112720 [==============================] - 3s - loss: 0.6575 - acc: 0.5648 - val_loss: 1.6731 - val_acc: 0.6330\n",
      "Epoch 38/50\n",
      "112720/112720 [==============================] - 3s - loss: 0.6565 - acc: 0.5670 - val_loss: 1.6737 - val_acc: 0.6329\n",
      "Epoch 39/50\n",
      "112720/112720 [==============================] - 3s - loss: 0.6555 - acc: 0.5695 - val_loss: 1.6725 - val_acc: 0.6321\n",
      "Epoch 40/50\n",
      "112720/112720 [==============================] - 3s - loss: 0.6543 - acc: 0.5713 - val_loss: 1.6698 - val_acc: 0.6376\n",
      "Epoch 41/50\n",
      "112720/112720 [==============================] - 3s - loss: 0.6531 - acc: 0.5738 - val_loss: 1.6686 - val_acc: 0.6384\n",
      "Epoch 42/50\n",
      "112720/112720 [==============================] - 3s - loss: 0.6516 - acc: 0.5766 - val_loss: 1.6680 - val_acc: 0.6394\n",
      "Epoch 43/50\n",
      "112720/112720 [==============================] - 3s - loss: 0.6503 - acc: 0.5800 - val_loss: 1.6663 - val_acc: 0.6377\n",
      "Epoch 44/50\n",
      "112720/112720 [==============================] - 3s - loss: 0.6492 - acc: 0.5810 - val_loss: 1.6649 - val_acc: 0.6415\n",
      "Epoch 45/50\n",
      "112720/112720 [==============================] - 3s - loss: 0.6481 - acc: 0.5831 - val_loss: 1.6579 - val_acc: 0.6419\n",
      "Epoch 46/50\n",
      "112720/112720 [==============================] - 3s - loss: 0.6472 - acc: 0.5832 - val_loss: 1.6632 - val_acc: 0.6424\n",
      "Epoch 47/50\n",
      "112720/112720 [==============================] - 3s - loss: 0.6462 - acc: 0.5845 - val_loss: 1.6563 - val_acc: 0.6390\n",
      "Epoch 48/50\n",
      "112720/112720 [==============================] - 3s - loss: 0.6455 - acc: 0.5833 - val_loss: 1.6558 - val_acc: 0.6430\n",
      "Epoch 49/50\n",
      "112720/112720 [==============================] - 3s - loss: 0.6444 - acc: 0.5856 - val_loss: 1.6541 - val_acc: 0.6407\n",
      "Epoch 50/50\n",
      "112720/112720 [==============================] - 3s - loss: 0.6435 - acc: 0.5867 - val_loss: 1.6504 - val_acc: 0.6426\n",
      "22544/22544 [==============================] - 0s     \n",
      "\n",
      " Train Acc: 0.5817955955862999, Test Acc: 0.6425656452775002\n",
      " \n",
      " Current Layer Attributes - epochs:50 hidden layers:10 features count:8\n",
      "Train on 112720 samples, validate on 22544 samples\n",
      "Epoch 1/50\n",
      "112720/112720 [==============================] - 5s - loss: 0.9941 - acc: 0.0038 - val_loss: 1.9898 - val_acc: 0.0012\n",
      "Epoch 2/50\n",
      "112720/112720 [==============================] - 3s - loss: 0.9359 - acc: 7.9844e-04 - val_loss: 1.9430 - val_acc: 0.0011\n",
      "Epoch 3/50\n",
      "112720/112720 [==============================] - 3s - loss: 0.8989 - acc: 0.0051 - val_loss: 1.8977 - val_acc: 0.0022\n",
      "Epoch 4/50\n",
      "112720/112720 [==============================] - 3s - loss: 0.8637 - acc: 0.0055 - val_loss: 1.8619 - val_acc: 0.0317\n",
      "Epoch 5/50\n",
      "112720/112720 [==============================] - 3s - loss: 0.8405 - acc: 0.0123 - val_loss: 1.8516 - val_acc: 0.0166\n",
      "Epoch 6/50\n"
     ]
    },
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "112720/112720 [==============================] - 3s - loss: 0.8308 - acc: 0.0111 - val_loss: 1.8451 - val_acc: 0.0205\n",
      "Epoch 7/50\n",
      "112720/112720 [==============================] - 3s - loss: 0.8229 - acc: 0.0119 - val_loss: 1.8376 - val_acc: 0.0089\n",
      "Epoch 8/50\n",
      "112720/112720 [==============================] - 3s - loss: 0.8131 - acc: 0.0449 - val_loss: 1.8291 - val_acc: 0.2878\n",
      "Epoch 9/50\n",
      "112720/112720 [==============================] - 3s - loss: 0.8038 - acc: 0.3386 - val_loss: 1.8158 - val_acc: 0.3585\n",
      "Epoch 10/50\n",
      "112720/112720 [==============================] - 3s - loss: 0.7949 - acc: 0.4003 - val_loss: 1.8148 - val_acc: 0.4237\n",
      "Epoch 11/50\n",
      "112720/112720 [==============================] - 3s - loss: 0.7850 - acc: 0.4214 - val_loss: 1.8065 - val_acc: 0.4561\n",
      "Epoch 12/50\n",
      "112720/112720 [==============================] - 3s - loss: 0.7745 - acc: 0.4293 - val_loss: 1.7903 - val_acc: 0.4608\n",
      "Epoch 13/50\n",
      "112720/112720 [==============================] - 3s - loss: 0.7649 - acc: 0.4382 - val_loss: 1.7762 - val_acc: 0.4828\n",
      "Epoch 14/50\n",
      "112720/112720 [==============================] - 3s - loss: 0.7533 - acc: 0.4546 - val_loss: 1.7680 - val_acc: 0.5019\n",
      "Epoch 15/50\n",
      "112720/112720 [==============================] - 3s - loss: 0.7446 - acc: 0.4607 - val_loss: 1.7610 - val_acc: 0.5160\n",
      "Epoch 16/50\n",
      "112720/112720 [==============================] - 3s - loss: 0.7381 - acc: 0.4751 - val_loss: 1.7632 - val_acc: 0.5199\n",
      "Epoch 17/50\n",
      "112720/112720 [==============================] - 3s - loss: 0.7334 - acc: 0.4918 - val_loss: 1.7536 - val_acc: 0.5340\n",
      "Epoch 18/50\n",
      "112720/112720 [==============================] - 3s - loss: 0.7287 - acc: 0.5000 - val_loss: 1.7531 - val_acc: 0.5334\n",
      "Epoch 19/50\n",
      "112720/112720 [==============================] - 3s - loss: 0.7259 - acc: 0.5006 - val_loss: 1.7406 - val_acc: 0.5364\n",
      "Epoch 20/50\n",
      "112720/112720 [==============================] - 2s - loss: 0.7213 - acc: 0.5010 - val_loss: 1.7393 - val_acc: 0.5360\n",
      "Epoch 21/50\n",
      "112720/112720 [==============================] - 2s - loss: 0.7184 - acc: 0.5027 - val_loss: 1.7488 - val_acc: 0.5372\n",
      "Epoch 22/50\n",
      "112720/112720 [==============================] - 2s - loss: 0.7159 - acc: 0.5033 - val_loss: 1.7391 - val_acc: 0.5376\n",
      "Epoch 23/50\n",
      "112720/112720 [==============================] - 3s - loss: 0.7123 - acc: 0.5046 - val_loss: 1.7283 - val_acc: 0.5387\n",
      "Epoch 24/50\n",
      "112720/112720 [==============================] - 3s - loss: 0.7098 - acc: 0.5069 - val_loss: 1.7301 - val_acc: 0.5390\n",
      "Epoch 25/50\n",
      "112720/112720 [==============================] - 3s - loss: 0.7079 - acc: 0.5080 - val_loss: 1.7206 - val_acc: 0.5403\n",
      "Epoch 26/50\n",
      "112720/112720 [==============================] - 3s - loss: 0.7079 - acc: 0.5098 - val_loss: 1.7237 - val_acc: 0.5401\n",
      "Epoch 27/50\n",
      "112720/112720 [==============================] - 3s - loss: 0.7047 - acc: 0.5145 - val_loss: 1.7195 - val_acc: 0.5460\n",
      "Epoch 28/50\n",
      "112720/112720 [==============================] - 3s - loss: 0.7020 - acc: 0.5173 - val_loss: 1.7171 - val_acc: 0.5476\n",
      "Epoch 29/50\n",
      "112720/112720 [==============================] - 3s - loss: 0.6999 - acc: 0.5211 - val_loss: 1.7061 - val_acc: 0.5442\n",
      "Epoch 30/50\n",
      "112720/112720 [==============================] - 3s - loss: 0.6978 - acc: 0.5234 - val_loss: 1.7062 - val_acc: 0.5467\n",
      "Epoch 31/50\n",
      "112720/112720 [==============================] - 3s - loss: 0.6962 - acc: 0.5240 - val_loss: 1.7006 - val_acc: 0.5488\n",
      "Epoch 32/50\n",
      "112720/112720 [==============================] - 3s - loss: 0.6956 - acc: 0.5244 - val_loss: 1.6972 - val_acc: 0.5487\n",
      "Epoch 33/50\n",
      "112720/112720 [==============================] - 3s - loss: 0.6931 - acc: 0.5256 - val_loss: 1.6976 - val_acc: 0.5491\n",
      "Epoch 34/50\n",
      "112720/112720 [==============================] - 3s - loss: 0.6923 - acc: 0.5272 - val_loss: 1.6937 - val_acc: 0.5462\n",
      "Epoch 35/50\n",
      "112720/112720 [==============================] - 3s - loss: 0.6914 - acc: 0.5300 - val_loss: 1.6884 - val_acc: 0.5533\n",
      "Epoch 36/50\n",
      "112720/112720 [==============================] - 3s - loss: 0.6886 - acc: 0.5357 - val_loss: 1.6838 - val_acc: 0.5535\n",
      "Epoch 37/50\n",
      "112720/112720 [==============================] - 3s - loss: 0.6875 - acc: 0.5394 - val_loss: 1.6876 - val_acc: 0.5549\n",
      "Epoch 38/50\n",
      "112720/112720 [==============================] - 3s - loss: 0.6872 - acc: 0.5418 - val_loss: 1.6795 - val_acc: 0.5485\n",
      "Epoch 39/50\n",
      "112720/112720 [==============================] - 3s - loss: 0.6855 - acc: 0.5429 - val_loss: 1.6734 - val_acc: 0.5574\n",
      "Epoch 40/50\n",
      "112720/112720 [==============================] - 3s - loss: 0.6836 - acc: 0.5485 - val_loss: 1.6737 - val_acc: 0.5570\n",
      "Epoch 41/50\n",
      "112720/112720 [==============================] - 3s - loss: 0.6823 - acc: 0.5497 - val_loss: 1.6695 - val_acc: 0.5603\n",
      "Epoch 42/50\n",
      "112720/112720 [==============================] - 3s - loss: 0.6808 - acc: 0.5506 - val_loss: 1.6689 - val_acc: 0.5603\n",
      "Epoch 43/50\n",
      "112720/112720 [==============================] - 3s - loss: 0.6799 - acc: 0.5500 - val_loss: 1.6658 - val_acc: 0.5628\n",
      "Epoch 44/50\n",
      "112720/112720 [==============================] - 3s - loss: 0.6787 - acc: 0.5487 - val_loss: 1.6623 - val_acc: 0.5642\n",
      "Epoch 45/50\n",
      "112720/112720 [==============================] - 3s - loss: 0.6776 - acc: 0.5507 - val_loss: 1.6589 - val_acc: 0.5660\n",
      "Epoch 46/50\n",
      "112720/112720 [==============================] - 3s - loss: 0.6771 - acc: 0.5521 - val_loss: 1.6573 - val_acc: 0.5649\n",
      "Epoch 47/50\n",
      "112720/112720 [==============================] - 3s - loss: 0.6759 - acc: 0.5541 - val_loss: 1.6565 - val_acc: 0.5695\n",
      "Epoch 48/50\n",
      "112720/112720 [==============================] - 3s - loss: 0.6743 - acc: 0.5536 - val_loss: 1.6530 - val_acc: 0.5734\n",
      "Epoch 49/50\n",
      "112720/112720 [==============================] - 3s - loss: 0.6732 - acc: 0.5552 - val_loss: 1.6559 - val_acc: 0.5765\n",
      "Epoch 50/50\n",
      "112720/112720 [==============================] - 3s - loss: 0.6726 - acc: 0.5573 - val_loss: 1.6505 - val_acc: 0.5763\n",
      "11272/11272 [==============================] - 0s     \n",
      "19726/22544 [=========================>....] - ETA: 0s\n",
      " Train Acc: 0.5482611730694771, Test Acc: 0.5762508884072304\n",
      " \n",
      " Current Layer Attributes - epochs:50 hidden layers:10 features count:16\n",
      "Train on 112720 samples, validate on 22544 samples\n",
      "Epoch 1/50\n",
      "112720/112720 [==============================] - 5s - loss: 0.9936 - acc: 0.0038 - val_loss: 1.9958 - val_acc: 0.0022\n",
      "Epoch 2/50\n",
      "112720/112720 [==============================] - 3s - loss: 0.9351 - acc: 6.6537e-04 - val_loss: 1.9433 - val_acc: 0.0026\n",
      "Epoch 3/50\n",
      "112720/112720 [==============================] - 3s - loss: 0.8963 - acc: 0.0113 - val_loss: 1.8932 - val_acc: 3.9922e-04\n",
      "Epoch 4/50\n",
      "112720/112720 [==============================] - 3s - loss: 0.8715 - acc: 9.1377e-04 - val_loss: 1.8732 - val_acc: 9.3151e-04\n",
      "Epoch 5/50\n",
      "112720/112720 [==============================] - 3s - loss: 0.8610 - acc: 7.5408e-04 - val_loss: 1.8626 - val_acc: 0.0020\n",
      "Epoch 6/50\n",
      "112720/112720 [==============================] - 3s - loss: 0.8485 - acc: 0.0131 - val_loss: 1.8582 - val_acc: 0.0348\n",
      "Epoch 7/50\n",
      "112720/112720 [==============================] - 3s - loss: 0.8395 - acc: 0.0141 - val_loss: 1.8564 - val_acc: 0.0347\n",
      "Epoch 8/50\n",
      "112720/112720 [==============================] - 3s - loss: 0.8342 - acc: 0.0130 - val_loss: 1.8531 - val_acc: 0.0315\n",
      "Epoch 9/50\n",
      "112720/112720 [==============================] - 3s - loss: 0.8279 - acc: 0.0287 - val_loss: 1.8495 - val_acc: 0.0394\n",
      "Epoch 10/50\n",
      "112720/112720 [==============================] - 3s - loss: 0.8197 - acc: 0.0496 - val_loss: 1.8400 - val_acc: 0.0571\n",
      "Epoch 11/50\n",
      "112720/112720 [==============================] - 3s - loss: 0.8076 - acc: 0.0916 - val_loss: 1.8313 - val_acc: 0.0986\n",
      "Epoch 12/50\n",
      "112720/112720 [==============================] - 3s - loss: 0.7957 - acc: 0.1735 - val_loss: 1.8197 - val_acc: 0.3594\n",
      "Epoch 13/50\n",
      "112720/112720 [==============================] - 3s - loss: 0.7841 - acc: 0.3594 - val_loss: 1.8106 - val_acc: 0.4162\n",
      "Epoch 14/50\n",
      "112720/112720 [==============================] - 3s - loss: 0.7762 - acc: 0.4418 - val_loss: 1.8002 - val_acc: 0.5180\n",
      "Epoch 15/50\n",
      "112720/112720 [==============================] - 3s - loss: 0.7674 - acc: 0.4906 - val_loss: 1.7898 - val_acc: 0.4688\n",
      "Epoch 16/50\n"
     ]
    },
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "112720/112720 [==============================] - 3s - loss: 0.7608 - acc: 0.5161 - val_loss: 1.7845 - val_acc: 0.5749\n",
      "Epoch 17/50\n",
      "112720/112720 [==============================] - 3s - loss: 0.7534 - acc: 0.5346 - val_loss: 1.7714 - val_acc: 0.5808\n",
      "Epoch 18/50\n",
      "112720/112720 [==============================] - 3s - loss: 0.7473 - acc: 0.5405 - val_loss: 1.7587 - val_acc: 0.5803\n",
      "Epoch 19/50\n",
      "112720/112720 [==============================] - 3s - loss: 0.7390 - acc: 0.5462 - val_loss: 1.7522 - val_acc: 0.5821\n",
      "Epoch 20/50\n",
      "112720/112720 [==============================] - 3s - loss: 0.7325 - acc: 0.5483 - val_loss: 1.7359 - val_acc: 0.5836\n",
      "Epoch 21/50\n",
      "112720/112720 [==============================] - 3s - loss: 0.7261 - acc: 0.5511 - val_loss: 1.7286 - val_acc: 0.5861\n",
      "Epoch 22/50\n",
      "112720/112720 [==============================] - 3s - loss: 0.7205 - acc: 0.5526 - val_loss: 1.7238 - val_acc: 0.5915\n",
      "Epoch 23/50\n",
      "112720/112720 [==============================] - 3s - loss: 0.7153 - acc: 0.5562 - val_loss: 1.7118 - val_acc: 0.5951\n",
      "Epoch 24/50\n",
      "112720/112720 [==============================] - 2s - loss: 0.7118 - acc: 0.5580 - val_loss: 1.7024 - val_acc: 0.6030\n",
      "Epoch 25/50\n",
      "112720/112720 [==============================] - 2s - loss: 0.7060 - acc: 0.5601 - val_loss: 1.6944 - val_acc: 0.6065\n",
      "Epoch 26/50\n",
      "112720/112720 [==============================] - 2s - loss: 0.7021 - acc: 0.5624 - val_loss: 1.6772 - val_acc: 0.6092\n",
      "Epoch 27/50\n",
      "112720/112720 [==============================] - 3s - loss: 0.6987 - acc: 0.5633 - val_loss: 1.6782 - val_acc: 0.6112\n",
      "Epoch 28/50\n",
      "112720/112720 [==============================] - 3s - loss: 0.6956 - acc: 0.5644 - val_loss: 1.6771 - val_acc: 0.6105\n",
      "Epoch 29/50\n",
      "112720/112720 [==============================] - 3s - loss: 0.6921 - acc: 0.5667 - val_loss: 1.6612 - val_acc: 0.6104\n",
      "Epoch 30/50\n",
      "112720/112720 [==============================] - 3s - loss: 0.6894 - acc: 0.5686 - val_loss: 1.6571 - val_acc: 0.6140\n",
      "Epoch 31/50\n",
      "112720/112720 [==============================] - 3s - loss: 0.6869 - acc: 0.5720 - val_loss: 1.6506 - val_acc: 0.6179\n",
      "Epoch 32/50\n",
      "112720/112720 [==============================] - 3s - loss: 0.6842 - acc: 0.5742 - val_loss: 1.6434 - val_acc: 0.6185\n",
      "Epoch 33/50\n",
      "112720/112720 [==============================] - 3s - loss: 0.6819 - acc: 0.5751 - val_loss: 1.6406 - val_acc: 0.6253\n",
      "Epoch 34/50\n",
      "112720/112720 [==============================] - 3s - loss: 0.6797 - acc: 0.5759 - val_loss: 1.6308 - val_acc: 0.6158\n",
      "Epoch 35/50\n",
      "112720/112720 [==============================] - 3s - loss: 0.6773 - acc: 0.5760 - val_loss: 1.6253 - val_acc: 0.6152\n",
      "Epoch 36/50\n",
      "112720/112720 [==============================] - 3s - loss: 0.6750 - acc: 0.5767 - val_loss: 1.6181 - val_acc: 0.6215\n",
      "Epoch 37/50\n",
      "112720/112720 [==============================] - 3s - loss: 0.6730 - acc: 0.5767 - val_loss: 1.6054 - val_acc: 0.6215\n",
      "Epoch 38/50\n",
      "112720/112720 [==============================] - 3s - loss: 0.6715 - acc: 0.5768 - val_loss: 1.6174 - val_acc: 0.6119\n",
      "Epoch 39/50\n",
      "112720/112720 [==============================] - 3s - loss: 0.6699 - acc: 0.5774 - val_loss: 1.6085 - val_acc: 0.6224\n",
      "Epoch 40/50\n",
      "112720/112720 [==============================] - 3s - loss: 0.6675 - acc: 0.5790 - val_loss: 1.5969 - val_acc: 0.6252\n",
      "Epoch 41/50\n",
      "112720/112720 [==============================] - 3s - loss: 0.6658 - acc: 0.5805 - val_loss: 1.5922 - val_acc: 0.6223\n",
      "Epoch 42/50\n",
      "112720/112720 [==============================] - 3s - loss: 0.6640 - acc: 0.5823 - val_loss: 1.5806 - val_acc: 0.6237\n",
      "Epoch 43/50\n",
      "112720/112720 [==============================] - 3s - loss: 0.6623 - acc: 0.5833 - val_loss: 1.5772 - val_acc: 0.6263\n",
      "Epoch 44/50\n",
      "112720/112720 [==============================] - 3s - loss: 0.6607 - acc: 0.5836 - val_loss: 1.5746 - val_acc: 0.6289\n",
      "Epoch 45/50\n",
      "112720/112720 [==============================] - 3s - loss: 0.6594 - acc: 0.5845 - val_loss: 1.5698 - val_acc: 0.6237\n",
      "Epoch 46/50\n",
      "112720/112720 [==============================] - 3s - loss: 0.6577 - acc: 0.5832 - val_loss: 1.5619 - val_acc: 0.6256\n",
      "Epoch 47/50\n",
      "112720/112720 [==============================] - 3s - loss: 0.6564 - acc: 0.5854 - val_loss: 1.5649 - val_acc: 0.6252\n",
      "Epoch 48/50\n",
      "112720/112720 [==============================] - 3s - loss: 0.6550 - acc: 0.5843 - val_loss: 1.5529 - val_acc: 0.6284\n",
      "Epoch 49/50\n",
      "112720/112720 [==============================] - 3s - loss: 0.6531 - acc: 0.5855 - val_loss: 1.5487 - val_acc: 0.6300\n",
      "Epoch 50/50\n",
      "112720/112720 [==============================] - 3s - loss: 0.6516 - acc: 0.5839 - val_loss: 1.5404 - val_acc: 0.6301\n",
      "11272/11272 [==============================] - 0s     \n",
      "19726/22544 [=========================>....] - ETA: 0s\n",
      " Train Acc: 0.5817068964242935, Test Acc: 0.6301011331379414\n",
      " \n",
      " Current Layer Attributes - epochs:50 hidden layers:10 features count:32\n",
      "Train on 112720 samples, validate on 22544 samples\n",
      "Epoch 1/50\n",
      "112720/112720 [==============================] - 5s - loss: 0.9807 - acc: 0.0037 - val_loss: 1.9464 - val_acc: 0.0000e+00\n",
      "Epoch 2/50\n",
      "112720/112720 [==============================] - 3s - loss: 0.9142 - acc: 0.0064 - val_loss: 1.9255 - val_acc: 0.0015\n",
      "Epoch 3/50\n",
      "112720/112720 [==============================] - 3s - loss: 6.4508 - acc: 0.0062 - val_loss: 1.9297 - val_acc: 9.7587e-04\n",
      "Epoch 4/50\n",
      "112720/112720 [==============================] - 3s - loss: 0.8823 - acc: 0.0086 - val_loss: 1.8744 - val_acc: 0.0016\n",
      "Epoch 5/50\n",
      "112720/112720 [==============================] - 3s - loss: 0.8549 - acc: 0.0141 - val_loss: 1.8545 - val_acc: 0.0176\n",
      "Epoch 6/50\n",
      "112720/112720 [==============================] - 3s - loss: 0.8393 - acc: 0.0192 - val_loss: 1.8457 - val_acc: 0.0329\n",
      "Epoch 7/50\n",
      "112720/112720 [==============================] - 3s - loss: 0.8291 - acc: 0.0193 - val_loss: 1.8392 - val_acc: 0.0277\n",
      "Epoch 8/50\n",
      "112720/112720 [==============================] - 3s - loss: 0.8205 - acc: 0.0180 - val_loss: 1.8321 - val_acc: 0.0185\n",
      "Epoch 9/50\n",
      "112720/112720 [==============================] - 3s - loss: 0.8111 - acc: 0.0197 - val_loss: 1.8258 - val_acc: 0.0291\n",
      "Epoch 10/50\n",
      "112720/112720 [==============================] - 3s - loss: 0.8006 - acc: 0.2135 - val_loss: 1.8182 - val_acc: 0.3246\n",
      "Epoch 11/50\n",
      "112720/112720 [==============================] - 3s - loss: 0.7916 - acc: 0.3147 - val_loss: 1.8137 - val_acc: 0.3540\n",
      "Epoch 12/50\n",
      "112720/112720 [==============================] - 3s - loss: 0.7846 - acc: 0.3309 - val_loss: 1.8078 - val_acc: 0.3690\n",
      "Epoch 13/50\n",
      "112720/112720 [==============================] - 3s - loss: 0.7783 - acc: 0.3387 - val_loss: 1.8025 - val_acc: 0.3763\n",
      "Epoch 14/50\n",
      "112720/112720 [==============================] - 3s - loss: 1.4573 - acc: 0.3360 - val_loss: 1.8035 - val_acc: 0.3705\n",
      "Epoch 15/50\n",
      "112720/112720 [==============================] - 3s - loss: 0.7733 - acc: 0.3393 - val_loss: 1.7966 - val_acc: 0.3698\n",
      "Epoch 16/50\n",
      "112720/112720 [==============================] - 3s - loss: 0.7672 - acc: 0.3328 - val_loss: 1.7908 - val_acc: 0.3751\n",
      "Epoch 17/50\n",
      "112720/112720 [==============================] - 3s - loss: 0.7624 - acc: 0.3386 - val_loss: 1.7859 - val_acc: 0.3743\n",
      "Epoch 18/50\n",
      "112720/112720 [==============================] - 3s - loss: 0.7582 - acc: 0.3434 - val_loss: 1.7822 - val_acc: 0.3910\n",
      "Epoch 19/50\n",
      "112720/112720 [==============================] - 3s - loss: 0.7545 - acc: 0.3554 - val_loss: 1.7789 - val_acc: 0.4204\n",
      "Epoch 20/50\n",
      "112720/112720 [==============================] - 3s - loss: 0.7513 - acc: 0.3582 - val_loss: 1.7762 - val_acc: 0.4229\n",
      "Epoch 21/50\n",
      "112720/112720 [==============================] - 3s - loss: 0.7485 - acc: 0.3580 - val_loss: 1.7744 - val_acc: 0.4213\n",
      "Epoch 22/50\n",
      "112720/112720 [==============================] - 3s - loss: 0.7458 - acc: 0.3592 - val_loss: 1.7723 - val_acc: 0.4223\n",
      "Epoch 23/50\n",
      "112720/112720 [==============================] - 3s - loss: 0.7435 - acc: 0.3594 - val_loss: 1.7706 - val_acc: 0.4242\n",
      "Epoch 24/50\n",
      "112720/112720 [==============================] - 3s - loss: 0.7412 - acc: 0.3593 - val_loss: 1.7691 - val_acc: 0.4226\n",
      "Epoch 25/50\n",
      "112720/112720 [==============================] - 3s - loss: 0.7392 - acc: 0.3587 - val_loss: 1.7671 - val_acc: 0.4209\n",
      "Epoch 26/50\n"
     ]
    },
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "112720/112720 [==============================] - 3s - loss: 0.7373 - acc: 0.3579 - val_loss: 1.7667 - val_acc: 0.4181\n",
      "Epoch 27/50\n",
      "112720/112720 [==============================] - 3s - loss: 0.7355 - acc: 0.3592 - val_loss: 1.7654 - val_acc: 0.4237\n",
      "Epoch 28/50\n",
      "112720/112720 [==============================] - 2s - loss: 0.7338 - acc: 0.3629 - val_loss: 1.7643 - val_acc: 0.4233\n",
      "Epoch 29/50\n",
      "112720/112720 [==============================] - 2s - loss: 0.7323 - acc: 0.3700 - val_loss: 1.7638 - val_acc: 0.4295\n",
      "Epoch 30/50\n",
      "112720/112720 [==============================] - 2s - loss: 0.7310 - acc: 0.3800 - val_loss: 1.7628 - val_acc: 0.4330\n",
      "Epoch 31/50\n",
      "112720/112720 [==============================] - 3s - loss: 0.7297 - acc: 0.3913 - val_loss: 1.7623 - val_acc: 0.4380\n",
      "Epoch 32/50\n",
      "112720/112720 [==============================] - 3s - loss: 0.7285 - acc: 0.4048 - val_loss: 1.7618 - val_acc: 0.4530\n",
      "Epoch 33/50\n",
      "112720/112720 [==============================] - 3s - loss: 0.7274 - acc: 0.4156 - val_loss: 1.7611 - val_acc: 0.4489\n",
      "Epoch 34/50\n",
      "112720/112720 [==============================] - 3s - loss: 0.7263 - acc: 0.4243 - val_loss: 1.7606 - val_acc: 0.4570\n",
      "Epoch 35/50\n",
      "112720/112720 [==============================] - 3s - loss: 0.7253 - acc: 0.4324 - val_loss: 1.7607 - val_acc: 0.4566\n",
      "Epoch 36/50\n",
      "112720/112720 [==============================] - 3s - loss: 0.7245 - acc: 0.4391 - val_loss: 1.7600 - val_acc: 0.4584\n",
      "Epoch 37/50\n",
      "112720/112720 [==============================] - 3s - loss: 0.7236 - acc: 0.4445 - val_loss: 1.7596 - val_acc: 0.4574\n",
      "Epoch 38/50\n",
      "112720/112720 [==============================] - 3s - loss: 0.7227 - acc: 0.4508 - val_loss: 1.7589 - val_acc: 0.4622\n",
      "Epoch 39/50\n",
      "112720/112720 [==============================] - 3s - loss: 0.7220 - acc: 0.4561 - val_loss: 1.7585 - val_acc: 0.4605\n",
      "Epoch 40/50\n",
      "112720/112720 [==============================] - 3s - loss: 0.7212 - acc: 0.4587 - val_loss: 1.7580 - val_acc: 0.4646\n",
      "Epoch 41/50\n",
      "112720/112720 [==============================] - 3s - loss: 0.7205 - acc: 0.4618 - val_loss: 1.7583 - val_acc: 0.4656\n",
      "Epoch 42/50\n",
      "112720/112720 [==============================] - 3s - loss: 0.7197 - acc: 0.4653 - val_loss: 1.7575 - val_acc: 0.4662\n",
      "Epoch 43/50\n",
      "112720/112720 [==============================] - 3s - loss: 0.7190 - acc: 0.4684 - val_loss: 1.7573 - val_acc: 0.4693\n",
      "Epoch 44/50\n",
      "112720/112720 [==============================] - 3s - loss: 0.7183 - acc: 0.4709 - val_loss: 1.7569 - val_acc: 0.4689\n",
      "Epoch 45/50\n",
      "112720/112720 [==============================] - 3s - loss: 0.7177 - acc: 0.4742 - val_loss: 1.7565 - val_acc: 0.4727\n",
      "Epoch 46/50\n",
      "112720/112720 [==============================] - 3s - loss: 0.7171 - acc: 0.4751 - val_loss: 1.7566 - val_acc: 0.4734\n",
      "Epoch 47/50\n",
      "112720/112720 [==============================] - 3s - loss: 0.7165 - acc: 0.4769 - val_loss: 1.7563 - val_acc: 0.4725\n",
      "Epoch 48/50\n",
      "112720/112720 [==============================] - 3s - loss: 0.7159 - acc: 0.4782 - val_loss: 1.7557 - val_acc: 0.4758\n",
      "Epoch 49/50\n",
      "112720/112720 [==============================] - 3s - loss: 0.7153 - acc: 0.4801 - val_loss: 1.7557 - val_acc: 0.4735\n",
      "Epoch 50/50\n",
      "112720/112720 [==============================] - 3s - loss: 0.7148 - acc: 0.4805 - val_loss: 1.7553 - val_acc: 0.4744\n",
      "22544/22544 [==============================] - 0s     \n",
      "\n",
      " Train Acc: 0.4767565652728081, Test Acc: 0.47444996051490307\n"
     ]
    }
   ],
   "source": [
    "import itertools\n",
    "#features_arr = [4, 16, 32, 256, 1024]\n",
    "#hidden_layers_arr = [2, 6, 10, 100]\n",
    "\n",
    "features_arr = [2, 4, 8, 16, 32]\n",
    "hidden_layers_arr = [2, 6, 10]\n",
    "\n",
    "epoch_arr = [50]\n",
    "\n",
    "score = namedtuple(\"score\", ['epoch', 'no_of_features','hidden_layers','train_score', 'test_score'])\n",
    "scores = []\n",
    "predictions = pd.DataFrame()\n",
    "\n",
    "for e, h, f in itertools.product(epoch_arr, hidden_layers_arr, features_arr):\n",
    "    \n",
    "    print(\" \\n Current Layer Attributes - epochs:{} hidden layers:{} features count:{}\".format(e,h,f))\n",
    "    latent_dim = f\n",
    "    epochs = e\n",
    "    hidden_layers = h\n",
    "\n",
    "    Train.train()\n",
    "\n",
    "    optimizer = keras.optimizers.Adam(lr=0.01, beta_1=0.9, beta_2=0.999, epsilon=1e-04, decay=0.1)\n",
    "    vae_model = Model(inputs = Train.x, outputs = Train.x_ )\n",
    "    vae_model.compile(optimizer = optimizer, loss = 'mse', metrics = ['accuracy'] )\n",
    "\n",
    "    train_size = x_train.shape[0] - x_train.shape[0]%batch_size\n",
    "    valid_size = x_valid.shape[0] - x_valid.shape[0]%batch_size\n",
    "\n",
    "    vae_model.fit(x = x_train[:train_size,:], y = x_train[:train_size,:], \n",
    "                  shuffle=True, epochs=epochs, \n",
    "                  batch_size = batch_size, \n",
    "                  validation_data = (x_test, x_test),\n",
    "                  verbose = 1)\n",
    "    \n",
    "    score_train = vae_model.evaluate(x_valid[:valid_size,:], y = x_valid[:valid_size,:],\n",
    "                               batch_size = batch_size,\n",
    "                               verbose = 1)\n",
    "    \n",
    "    score_test = vae_model.evaluate(x_test, y = x_test,\n",
    "                           batch_size = batch_size,\n",
    "                           verbose = 1)\n",
    "    \n",
    "    scores.append(score(e,f,h,score_train[-1], score_test[-1])) #score_test[-1]))\n",
    "    \n",
    "    print(\"\\n Train Acc: {}, Test Acc: {}\".format(score_train[-1], \n",
    "                                                  score_test[-1])  )\n",
    "    \n",
    "scores = pd.DataFrame(scores)\n"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 5,
   "metadata": {
    "ExecuteTime": {
     "end_time": "2017-05-10T18:01:23.846210Z",
     "start_time": "2017-05-10T18:01:23.826718Z"
    }
   },
   "outputs": [
    {
     "data": {
      "text/html": [
       "<div>\n",
       "<table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr style=\"text-align: right;\">\n",
       "      <th></th>\n",
       "      <th>epoch</th>\n",
       "      <th>no_of_features</th>\n",
       "      <th>hidden_layers</th>\n",
       "      <th>train_score</th>\n",
       "      <th>test_score</th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th>6</th>\n",
       "      <td>50</td>\n",
       "      <td>4</td>\n",
       "      <td>6</td>\n",
       "      <td>0.853620</td>\n",
       "      <td>0.795156</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2</th>\n",
       "      <td>50</td>\n",
       "      <td>8</td>\n",
       "      <td>2</td>\n",
       "      <td>0.755500</td>\n",
       "      <td>0.786329</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>8</th>\n",
       "      <td>50</td>\n",
       "      <td>16</td>\n",
       "      <td>6</td>\n",
       "      <td>0.727289</td>\n",
       "      <td>0.744056</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>10</th>\n",
       "      <td>50</td>\n",
       "      <td>2</td>\n",
       "      <td>10</td>\n",
       "      <td>0.715312</td>\n",
       "      <td>0.677209</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>3</th>\n",
       "      <td>50</td>\n",
       "      <td>16</td>\n",
       "      <td>2</td>\n",
       "      <td>0.666519</td>\n",
       "      <td>0.653478</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>11</th>\n",
       "      <td>50</td>\n",
       "      <td>4</td>\n",
       "      <td>10</td>\n",
       "      <td>0.581796</td>\n",
       "      <td>0.642566</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>5</th>\n",
       "      <td>50</td>\n",
       "      <td>2</td>\n",
       "      <td>6</td>\n",
       "      <td>0.600869</td>\n",
       "      <td>0.636267</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>1</th>\n",
       "      <td>50</td>\n",
       "      <td>4</td>\n",
       "      <td>2</td>\n",
       "      <td>0.595635</td>\n",
       "      <td>0.631609</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>13</th>\n",
       "      <td>50</td>\n",
       "      <td>16</td>\n",
       "      <td>10</td>\n",
       "      <td>0.581707</td>\n",
       "      <td>0.630101</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>0</th>\n",
       "      <td>50</td>\n",
       "      <td>2</td>\n",
       "      <td>2</td>\n",
       "      <td>0.558286</td>\n",
       "      <td>0.622826</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>7</th>\n",
       "      <td>50</td>\n",
       "      <td>8</td>\n",
       "      <td>6</td>\n",
       "      <td>0.697126</td>\n",
       "      <td>0.598740</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>12</th>\n",
       "      <td>50</td>\n",
       "      <td>8</td>\n",
       "      <td>10</td>\n",
       "      <td>0.548261</td>\n",
       "      <td>0.576251</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>14</th>\n",
       "      <td>50</td>\n",
       "      <td>32</td>\n",
       "      <td>10</td>\n",
       "      <td>0.476757</td>\n",
       "      <td>0.474450</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>9</th>\n",
       "      <td>50</td>\n",
       "      <td>32</td>\n",
       "      <td>6</td>\n",
       "      <td>0.247516</td>\n",
       "      <td>0.189407</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>4</th>\n",
       "      <td>50</td>\n",
       "      <td>32</td>\n",
       "      <td>2</td>\n",
       "      <td>0.005145</td>\n",
       "      <td>0.000177</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "</div>"
      ],
      "text/plain": [
       "    epoch  no_of_features  hidden_layers  train_score  test_score\n",
       "6      50               4              6     0.853620    0.795156\n",
       "2      50               8              2     0.755500    0.786329\n",
       "8      50              16              6     0.727289    0.744056\n",
       "10     50               2             10     0.715312    0.677209\n",
       "3      50              16              2     0.666519    0.653478\n",
       "11     50               4             10     0.581796    0.642566\n",
       "5      50               2              6     0.600869    0.636267\n",
       "1      50               4              2     0.595635    0.631609\n",
       "13     50              16             10     0.581707    0.630101\n",
       "0      50               2              2     0.558286    0.622826\n",
       "7      50               8              6     0.697126    0.598740\n",
       "12     50               8             10     0.548261    0.576251\n",
       "14     50              32             10     0.476757    0.474450\n",
       "9      50              32              6     0.247516    0.189407\n",
       "4      50              32              2     0.005145    0.000177"
      ]
     },
     "execution_count": 5,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "scores.sort_values(\"test_score\", ascending=False)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 6,
   "metadata": {
    "ExecuteTime": {
     "end_time": "2017-05-10T18:01:23.935243Z",
     "start_time": "2017-05-10T18:01:23.847923Z"
    },
    "collapsed": true
   },
   "outputs": [],
   "source": [
    "scores.to_pickle(\"dataset/vae_only_feature_extraction_scores.pkl\")"
   ]
  }
 ],
 "metadata": {
  "_draft": {
   "nbviewer_url": "https://gist.github.com/33dcb1bcf3ca4a3461c4405a003a7591"
  },
  "anaconda-cloud": {},
  "gist": {
   "data": {
    "description": "Final Hyper parameter tuning",
    "public": false
   },
   "id": "33dcb1bcf3ca4a3461c4405a003a7591"
  },
  "kernelspec": {
   "display_name": "Python [conda env:p3]",
   "language": "python",
   "name": "conda-env-p3-py"
  },
  "language_info": {
   "codemirror_mode": {
    "name": "ipython",
    "version": 3
   },
   "file_extension": ".py",
   "mimetype": "text/x-python",
   "name": "python",
   "nbconvert_exporter": "python",
   "pygments_lexer": "ipython3",
   "version": "3.6.1"
  }
 },
 "nbformat": 4,
 "nbformat_minor": 2
}
